Skip to content

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).

Setup > Blocks > Layouts unifies Template, Page, Global, and Panel Layouts in one filterable workspace.

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 own blocks field 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 optional header_layout and footer_layout Global Layouts.

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 fields templates, parents, page_selector, and priority).
  • Composable Rule Targeting: Combine async templates, parents, and a DynamicSelectorGuard-sanitized page_selector with a numeric priority tie-breaker and inherit_regions fallback.
  • Resolution Precedence (LayoutManager::forPage()):
    1. Direct scope: page (pages)
    2. Composable scope: page ranked by specificity (parents > page_selector > templates > priority)
    3. Explicit Template Layout
    4. Fallback Template Layout with handle default

Author shared site-wide regions (such as header and footer) referenced by unique handle:

  • Attach directly to Template or Page Layouts via header_layout and footer_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) marks shared: true so 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_role Values: megamenu, modal, drawer, sidebar, overlay, popover, banner. Register custom roles via $blocks->registerPanelRole('quick_cart', 'Quick Cart') or the Blocks::registerPanelRoles hook.
  • Container Metadata (LayoutManager::extractPanelConfig()): Configure panel_width (auto, container, sm, md, lg, xl, 2xl, full), panel_surface (default, primary, secondary, muted, dark, transparent, plus _tokens.yaml tokens), and panel_padding (none, xs, sm, md, lg, xl, 2xl).
  • Context Safety: blocks_page_slot and any block declaring disallowContexts: ['panel_layout'] are rejected inside panels, and nested panel rendering enforces MAX_PANEL_DEPTH = 1.
  • Rendering Panels: Call $blocks->panelProps('aegean_fleet_menu') for React/Inertia or $blocks->renderPanel('aegean_fleet_menu') for native PHP. When Navigation is installed, published megamenu panels appear automatically in top-level navigation item pickers (Navigation::panelOptions()).

Next steps