@php // Switched off in Admin -> Pages: the hero does not draw. if (!section_on('hero-hungry')) { return; } /** * Hungry-page hero — a bold, appetite-driven slider: a vibrant gradient panel with a punchy * prompt, a search, craving chips and a rotating collage of popular-dish photos. Reuses the * .qm-heroslider shell (home.js drives it); the slide internals are this page's own design. * @var array $popular popular menu-item rows (for the dish collage) */ $popular = collect($popular ?? [])->values()->all(); $cravings = array_slice($cravingTags ?? [], 0, 6); $prompts = [ [t('home.hungry.p1_pre'), t('home.hungry.p1_hl'), t('home.hungry.p1_sub')], [t('home.hungry.p2_pre'), t('home.hungry.p2_hl'), t('home.hungry.p2_sub')], [t('home.hungry.p3_pre'), t('home.hungry.p3_hl'), t('home.hungry.p3_sub')], ]; // Each slide is switched on its own in Admin -> Pages: HomeSection::HERO_SLIDES registers this // hero's three and its fields are grouped per slide, so the editor draws a "Visible" switch on // every slide fold. This deck drew all three whatever those switches said — three controls that // changed nothing. Read them the way the homepage slider reads its own (sections/hero-slider.php). // The ORIGINAL index stays as the key so a slide keeps its own dish cluster and field id, while // $sN below numbers what is left: a hidden slide must not leave a dot that scrolls to nothing. $slides = []; foreach (\App\Services\HomeSection::slidesOf('hero-hungry') as $sIdx => $sid) { if (isset($prompts[$sIdx]) && \App\Services\HomeSection::slideOn('hero-hungry', $sid)) { $slides[$sIdx] = $prompts[$sIdx]; } } if (!$slides) { return; } $n = count($slides); $sN = 0; // running position of the slide being drawn @endphp
@foreach ($slides as $i => $pr) @php $sN++; $cluster = array_slice($popular, $i * 4, 5); @endphp @endforeach
@for ($d = 0; $d < $n; $d++) @endfor