@extends('admin.layout')
@section('title', 'Edit Page — '.$page->title)
@section('content')
Visual Drag & Drop Page (legacy)
Design this page freely — drag, drop, and style any element, no fixed sections.
Open Visual Designer →
@elseif ($page->isCanvas())
Freeform Canvas Page
Draw your layout — drag any element anywhere, resize it by hand, and it becomes real code on the page.
Open Freeform Canvas →
@else
@if ($page->blocks->isNotEmpty())
Want full freeform control? Switch this page to the drag-anywhere canvas — your current blocks are laid out for you at their current height so nothing jumps, then you can drag anything into place.
@endif
@php
$blockTypes = \App\Models\PageBlock::types();
$createUrl = route('admin.pages.blocks.create', $page);
// A little Blade partial-in-place: the "+" you hover between any two
// blocks (and before the first / after the last) — exactly like the
// WordPress block editor's inserter. Clicking it opens a small menu
// of block types; picking one creates it at that exact position.
$inserter = function (int $position, bool $prominent = false) use ($blockTypes, $createUrl) {
return view('admin.pages.blocks._inserter', [
'position' => $position,
'prominent' => $prominent,
'blockTypes' => $blockTypes,
'createUrl' => $createUrl,
])->render();
};
@endphp
{{-- CANVAS: a live preview of the real page, edited in place — click
any text to type directly into it, drag a block's ⠿ handle to
reorder it, or hover between blocks for a "+" to insert a new
one right there. --}}
This is what the page actually looks like. Click any text to edit it, drag the ⠿ handle to reorder a block, or hover between blocks for a "+" to add one there.
{!! $inserter(0, $page->blocks->isEmpty()) !!}
@foreach ($page->blocks as $block)
{{ \App\Models\PageBlock::types()[$block->type] ?? $block->type }}
@include('blocks.'.$block->type, ['data' => $block->data, 'adminEditable' => true])
{!! $inserter($loop->iteration) !!}
@endforeach
{{-- TOOLS PANEL --}}
Page Settings