@extends('layouts.dashboard') @section('content') @php /** * Appearance → Sub-header: the storefront "page band" shown above CMS pages and blog posts. * A style per content type (classic / modern / hidden), plus per-style breadcrumb / * description toggles and an optional background image or video. Defaults reproduce the * shipped storefront (posts → modern, pages → classic). Built from existing components only. */ $shStyle = static function (string $slot): string { $v = setting('subheader_' . $slot . '_style', ''); return in_array($v, ['hidden', 'classic', 'modern'], true) ? $v : ($slot === 'posts' ? 'modern' : 'classic'); }; @endphp

{{ t_raw('admin.subheader.content_heading') }}

@csrf
@foreach (['pages', 'posts'] as $slot) @php $cur = $shStyle($slot); @endphp
@endforeach
@foreach (['classic' => 'admin.subheader.style_classic', 'modern' => 'admin.subheader.style_modern'] as $st => $lbl) @php $bgType = setting('subheader_' . $st . '_bg_type', 'none'); $bgType = in_array($bgType, ['none', 'image', 'video'], true) ? $bgType : 'none'; $bgImage = trim((string) setting('subheader_' . $st . '_bg_image', '')); $bgVideo = trim((string) setting('subheader_' . $st . '_bg_video', '')); $crumbsOn = setting('subheader_' . $st . '_breadcrumbs', '1') === '1'; $descOn = setting('subheader_' . $st . '_description', '1') === '1'; $open = $st === 'classic'; @endphp

{!! media_field_html($st . '_bg_image', $bgImage, ['accept' => 'image', 'allowClear' => true, 'id' => 'sh-' . $st . '-image']) !!}
{!! media_field_html($st . '_bg_video', $bgVideo, ['accept' => 'video', 'allowClear' => true, 'id' => 'sh-' . $st . '-video']) !!}
@endforeach
@endsection