@php // Per-preset card modifier (e.g. 'style-3' for home-garden's tag-on-image variant). $cardModifier = trim((string) ($shortcode->card_modifier ?? '')); $categoryLabels = array_values(array_filter(array_map('trim', explode('|', (string) ($shortcode->category_labels ?? ''))))); $showCategories = ($shortcode->show_categories ?? 'no') === 'yes' || ! empty($categoryLabels); $headingTag = in_array($shortcode->heading_tag ?? '', ['h4', 'h5'], true) ? $shortcode->heading_tag : 'h5'; $imageSize = trim((string) ($shortcode->image_size ?? 'medium')) ?: null; // data_preview: desktop slides-per-view — default 3 (legacy). home-cosmetic §10 // demo is 2-up (html/home-cosmetic.html line 2475). Pagination-lg follows it. // NB: cache the raw value before casting — `(int) ($shortcode->data_preview ?? 3)` // inside `in_array()` defaults correctly, but re-evaluating `(int) $shortcode->data_preview` // on the true-branch loses the `?? 3` fallback and renders `data-preview="0"` // when the attribute is unset (HomeSneaker §9 bug discovered 2026-05-15). $dataPreviewRaw = $shortcode->data_preview ?? 3; $dataPreview = in_array((int) $dataPreviewRaw, [1, 2, 3, 4], true) ? (int) $dataPreviewRaw : 3; @endphp
@forelse ($posts as $post) @php $categoryLabel = $categoryLabels[$loop->index] ?? $post->categories->first()?->name; @endphp
index > 0) data-wow-delay="{{ number_format($loop->index / 10, 1) }}s" @endif> {!! RvMedia::image($post->image ?? null, $post->name, $imageSize, false, [ 'loading' => 'lazy', 'style' => 'aspect-ratio: 4 / 3; object-fit: cover; width: 100%; height: auto;' ]) !!} @if ($showCategories && $categoryLabel)
{!! BaseHelper::clean(mb_strtoupper($categoryLabel)) !!}
@endif
@if ($showMeta) @endif <{{ $headingTag }} class="entry-title"> {!! BaseHelper::clean($post->name) !!} @if ($showExcerpt && ! empty($post->description))

{!! BaseHelper::clean($post->description) !!}

@endif
@empty
{{ __('No posts found.') }}
@endforelse