@php $v = \App\Support\Tokens::detokenizeDeep($block->current()); $o = $block->getAttribute('original') ?? []; @endphp @switch($block->type) @case('heading') @if (($o['link'] ?? null) !== null) @endif @php($chosenTag = ($block->getAttribute('value') ?? [])['tag'] ?? null) @php($chosenTag = $chosenTag !== ($o['tag'] ?? null) ? $chosenTag : null) @break @case('text')
Text
@break @case('button')
@break @case('image')
Image
@if (($o['link'] ?? '') !== '')@endif @if (($o['caption'] ?? null) !== null)@endif
@break @case('gallery') @case('wpgallery') @php($titleKey = $block->type === 'gallery' ? 'title' : 'alt') @break @case('list')
@foreach ($v['items'] ?? [] as $item)
@endforeach
@break @case('box') @if (($o['image'] ?? null) !== null)
Image
@endif
Description
@break @case('menu')

Change the order with ↑ ↓. “+ Sub-item” adds a drop-down entry. Use # as the link for headings that only open a drop-down.

@include('admin.pages._menu', ['items' => $v['items'] ?? [], 'depth' => 0]) @break @case('video') @break @case('icon') @if (($o['url'] ?? null) !== null) @endif @break @case('posts')

This list fills itself with the newest posts{{ ! empty($o['terms']) ? ' in “'.implode(', ', $o['terms']).'”' : '' }}{{ ($o['orderby'] ?? 'post_date') === 'post_title' ? ' (sorted by title)' : '' }}. Publish a post and it appears here automatically.

@break @case('form') @php($form = \App\Models\Form::where('widget_id', $block->widgetId())->where('wp_post_id', $page->wp_id)->first() ?? \App\Models\Form::where('widget_id', $block->widgetId())->first())

The fields are part of the design. Recipients, messages and validation: @if ($form)open form settings@else not available @endif

@break @default

Edit the HTML of this {{ str_replace('-', ' ', $v['widget'] ?? 'block') }}. Keep the existing structure and classes so the design stays intact.

@endswitch