Layouts: Template, Page, Global & Panel
Blocks manages four layout scopes inside the blocks-layouts collection (Setup > Blocks > Layouts). Active state uses ProcessWire’s native Entry status, and the list table displays a computed Target (target_summary) column alongside scope filter pills (Template, Page, Global, Panel).
1. Template Layouts (scope: template)
Section titled “1. Template Layouts (scope: template)”Bind a shared page shell to one or more ProcessWire templates:
- 1:1 Template Invariant (
LayoutAssignmentValidator): Each ProcessWire template can be assigned to at most one Template Layout (1 Template = Max 1 Layout). blocks_page_slot: Place a Page Blocks Slot inside the layout to mark where each page’s ownblocksfield renders.- Governance Allowlists: Restrict which Block Types (
allowedBlocks), Reusable Blocks (allowReusable,allowedReusables), and Presets (allowedPresets) editors may insert on pages using this layout, and attach optionalheader_layoutandfooter_layoutGlobal Layouts.
2. Page Layouts (scope: page)
Section titled “2. Page Layouts (scope: page)”Override a Template Layout for specific pages or dynamic subsets of the page tree:
- Direct Page Targeting (
pages): Select one or more specific pages (1 Page = Max 1 Direct Page Layout; selecting direct pages disables rule fieldstemplates,parents,page_selector, andpriority). - Composable Rule Targeting: Combine async
templates,parents, and aDynamicSelectorGuard-sanitizedpage_selectorwith a numericprioritytie-breaker andinherit_regionsfallback. - Resolution Precedence (
LayoutManager::forPage()):- Direct
scope: page(pages) - Composable
scope: pageranked by specificity (parents>page_selector>templates>priority) - Explicit
Template Layout - Fallback
Template Layoutwith handledefault
- Direct
3. Global Layouts (scope: global)
Section titled “3. Global Layouts (scope: global)”Author shared site-wide regions (such as header and footer) referenced by unique handle:
- Attach directly to Template or Page Layouts via
header_layoutandfooter_layout, or render standalone via$blocks->layoutProps('site_header')/$blocks->renderLayout('site_header'). - When a Global Header or Footer contains no page-specific blocks,
Blocks::layoutRegions($page)marksshared: trueso Inertia v3 pages deliver it once per session via$inertia->once().
4. Panel Layouts & Mega-Menus (scope: panel)
Section titled “4. Panel Layouts & Mega-Menus (scope: panel)”Build reusable overlay and navigation panels without a blocks_page_slot:
- Starter
panel_roleValues:megamenu,modal,drawer,sidebar,overlay,popover,banner. Register custom roles via$blocks->registerPanelRole('quick_cart', 'Quick Cart')or theBlocks::registerPanelRoleshook. - Container Metadata (
LayoutManager::extractPanelConfig()): Configurepanel_width(auto,container,sm,md,lg,xl,2xl,full),panel_surface(default,primary,secondary,muted,dark,transparent, plus_tokens.yamltokens), andpanel_padding(none,xs,sm,md,lg,xl,2xl). - Context Safety:
blocks_page_slotand any block declaringdisallowContexts: ['panel_layout']are rejected inside panels, and nested panel rendering enforcesMAX_PANEL_DEPTH = 1. - Rendering Panels: Call
$blocks->panelProps('aegean_fleet_menu')for React/Inertia or$blocks->renderPanel('aegean_fleet_menu')for native PHP. WhenNavigationis installed, publishedmegamenupanels appear automatically in top-level navigation item pickers (Navigation::panelOptions()).