@php /** * Shared storefront sub-header ("page band"), controlled from Admin → Appearance → * Navigation. One partial renders EITHER the classic (.qm-page-head) or the modern * (.qm-blogm-head) style — never a third — for a content type ('page' | 'post'), and * honours the per-style breadcrumb / description toggles plus an optional background * image or video. * * The caller passes the CONTENT (already the right copy for that view); the admin * settings decide the STYLE. Defaults reproduce today's storefront exactly — posts → * modern, pages → classic, breadcrumb + description on, no background media. * * Callers pass RAW strings (t_raw(...) / model values); this partial escapes with e(). * * @var string $type 'page' (CMS pages) | 'post' (blog + post detail) * @var string $title heading text * @var array $crumbs [['label' => string, 'url' => ?string], ...] — last = active * @var string $description optional lead / subtitle * @var string $eyebrow optional eyebrow, modern style only */ $type = ($type ?? 'page') === 'post' ? 'post' : 'page'; $title = (string) ($title ?? ''); $crumbs = is_array($crumbs ?? null) ? $crumbs : []; $desc = trim((string) ($description ?? '')); $eyebrow = trim((string) ($eyebrow ?? '')); // Style + hide are resolved per content type; the fallbacks are today's defaults. $slot = $type === 'post' ? 'posts' : 'pages'; $style = setting('subheader_' . $slot . '_style', $type === 'post' ? 'modern' : 'classic'); if (!in_array($style, ['classic', 'modern', 'hidden'], true)) { $style = $type === 'post' ? 'modern' : 'classic'; } if ($style === 'hidden') { return; } $showCrumbs = $crumbs !== [] && setting('subheader_' . $style . '_breadcrumbs', '1') === '1'; $showDesc = $desc !== '' && setting('subheader_' . $style . '_description', '1') === '1'; // Optional background media (uploaded image or MP4) sits full-bleed behind the band with // a scrim for legibility. Nothing set = the shipped CSS-gradient band, unchanged. $bgType = setting('subheader_' . $style . '_bg_type', 'none'); $bgMedia = $bgType === 'image' ? trim((string) setting('subheader_' . $style . '_bg_image', '')) : ($bgType === 'video' ? trim((string) setting('subheader_' . $style . '_bg_video', '')) : ''); $bgHtml = $bgMedia !== '' ? '' : ''; $lastIdx = count($crumbs) - 1; @endphp @if ($style === 'modern')
{!! $bgHtml !!}
@if ($eyebrow !== '') {{ $eyebrow }}@endif

{{ $title }}

@if ($showDesc)

{{ $desc }}

@endif @if ($showCrumbs) @endif
@else
{!! $bgHtml !!}

{{ $title }}

@if ($showDesc)

{{ $desc }}

@endif @if ($showCrumbs) @endif
@endif @php /* The page's messages belong INSIDE the page, under its title band — not floating above the subheader where the reader has already scrolled past. Pages with no subheader keep getting it from the layout. */ @endphp
@partial('flash')