@php use Botble\Base\Facades\BaseHelper; use Botble\Media\Facades\RvMedia; /** * lookbook-hotspot style-3-up-swiper-banners — `data-preview="3"` swiper of * full-width shoppable `banner-lookbook wrap-lookbook_hover` banners. * Mirrors html/home-bag-accessories.html §7 "Lookbook" (lines 2575-2688): * three 570x570 radius-20 banner slides inside `container-full`, each with * exactly one hotspot pin (preset position16/17/18) — no heading. * * Hotspots are split between the three banners by their `column` value * (1 → banner 1, 2 → banner 2, 3 → banner 3). Each banner takes only its * first matching pin and emits a single `lookbook-item position{16 + banner}` * matching the demo's hard-coded preset positions. * * Banner art is square (570x570) — passed as the original image (no RvMedia * size string would double-crop it). * * Section index wraps this in `
`. */ $hotspots = $hotspots ?? []; $image1 = $shortcode->image ?? null; $image2 = $shortcode->image_2 ?? null; $image3 = $shortcode->image_3 ?? null; // Split hotspots into the three banners by `column` (default column 1). $pinsByColumn = [1 => [], 2 => [], 3 => []]; foreach ($hotspots as $h) { $col = (int) ($h['column'] ?? 1); if (! isset($pinsByColumn[$col])) { $col = 1; } $pinsByColumn[$col][] = $h; } $banners = []; foreach ([$image1, $image2, $image3] as $bIdx => $img) { if (! empty($img)) { $banners[] = ['image' => $img, 'pin' => $pinsByColumn[$bIdx + 1][0] ?? null]; } } @endphp
@foreach ($banners as $i => $banner)
@endforeach