{{-- Shared page-section form. Expects: $item (null on create), $page, $type, $registry, $types, $statuses, $pages. There is no background control: the engine shades every other section from its position on the page, and the two shipped exceptions (the promo rail sitting flush under the hero, the closing CTA against the footer) are pinned in config/sections.php. --}} @php $selectedType = old('type', $type ?? $item->type ?? null); $sectionType = $selectedType ? $registry->find($selectedType) : null; $settings = $item && is_array($item->settings) ? $item->settings : []; // The wording the section ships with, shown as placeholder text: an admin // sees what it currently says, and what clearing a field falls back to. $shipped = $sectionType ? $sectionType->defaultCopy() : []; @endphp
@if($item) {{-- Fixed once placed: switching type would leave the old type's settings behind. Delete and add instead. --}} @else {{ ___('label.section_type_hint') }} @endif @error('type') {{ $message }} @enderror
{{ ___('label.section_heading_override_hint') }} @if($shipped)
{{ ___('label.section_shipped_copy_hint') }}
@endif
@error('eyebrow') {{ $message }} @enderror
@error('title') {{ $message }} @enderror
@error('subtitle') {{ $message }} @enderror
@error('cta_text') {{ $message }} @enderror
@error('cta_link') {{ $message }} @enderror
@if($sectionType)
{{ ___('label.section_settings') }}
@include('backend.cms.home-section._schema-form', [ 'schema' => $sectionType->schema(), 'values' => $settings, ])
@endif
{{ ___('label.cancel') }}
@if(! $item) @push('scripts') @endpush @endif