[collection 3 — image + text below]
*
* Expects exactly 3 collections; gracefully degrades if fewer.
*/
$list = collect($collections)->values();
$left = $list->get(0);
$right1 = $list->get(1);
$right2 = $list->get(2);
// Per-cell description (eyebrow under headline). Fall back to collection
// description; admins can also pin per-cell via shortcode attrs
// `desc_1`, `desc_2`, `desc_3` (matching demo's "Up to 50% Off Bestsellers").
$desc = static function ($collection, $attrName, $shortcode) {
$attr = trim((string) ($shortcode->{$attrName} ?? ''));
if ($attr !== '') {
return $attr;
}
return trim((string) ($collection->description ?? '')) ?: __('Up to 50% Off Bestsellers');
};
$btnText = trim((string) ($shortcode->button_text ?? __('Shop Now')));
// Optional per-cell title override (HTML allowed) — admins can pin per-cell titles to match
// demo wording like "Jacquard Bucket
Bag With Logo" via shortcode attrs `title_1/2/3`.
// Falls back to collection name when empty.
$title = static function ($collection, string $attrName, $shortcode): string {
$attr = trim((string) ($shortcode->{$attrName} ?? ''));
if ($attr !== '') {
return $attr;
}
return (string) ($collection->name ?? '');
};
@endphp
@if ($left)
{{-- LEFT — tall card with white overlay text (demo: 690x922 portrait) --}}
{{-- RIGHT — 2 stacked cards with text below image (demo: 690x446 landscape) --}}
@if ($right1 || $right2)
@if ($right1)
@endif
@if ($right2)
@endif
@endif
@endif