{{-- Blog plugin's `[blog-posts]` shortcode renderer looks for this view path (Theme::getThemeNamespace() . "::views.templates.posts") and falls back to its plain
default if missing. Wraps the theme's blog-posts style partials so the rendered shortcode matches the rest of the design system. --}} @php $allowed = ['style-grid', 'style-slider', 'style-list', 'style-insights-split']; $style = in_array($shortcode->style ?? '', $allowed, true) ? $shortcode->style : 'style-grid'; $showExcerpt = ($shortcode->show_excerpt ?? 'yes') === 'yes'; $showMeta = ($shortcode->show_meta ?? 'yes') === 'yes'; $sectionClass = trim((string) ($shortcode->section_class ?? 'flat-spacing-2')); $containerClass = trim((string) ($shortcode->container_class ?? 'container')); $limit = (int) ($shortcode->limit ?? 4); $items = $posts; if ($items instanceof \Illuminate\Support\Collection || $items instanceof \Illuminate\Pagination\AbstractPaginator) { if (($shortcode->order_by ?? '') === 'oldest') { $items = $items->sortBy([ ['created_at', 'asc'], ['id', 'asc'], ]); } $items = $items->take($limit > 0 ? $limit : 4); } @endphp
htmlAttributes() !!} class="{{ $sectionClass }} blog-posts-{{ $style }}">
@if (! empty($shortcode->title ?? '') || ! empty($shortcode->subtitle ?? ''))
@if (! empty($shortcode->title ?? ''))

{!! BaseHelper::clean($shortcode->title) !!}

@endif @if (! empty($shortcode->subtitle ?? ''))

{!! BaseHelper::clean($shortcode->subtitle) !!}

@endif
@endif @include(Theme::getThemeNamespace("partials.shortcodes.blog-posts.styles.$style"), [ 'shortcode' => $shortcode, 'posts' => $items, 'showExcerpt' => $showExcerpt, 'showMeta' => $showMeta, ])