Skip to content

Why Navigation?

ProcessWire’s page tree is a great way to organize content, so simple sites often build menus by looping over $pages->get(1)->children(). As soon as marketing and editorial teams need curated header dropdowns, multi-column footers, external links, mega-menu badges, or mixed Page and Entry targets, coupling navigation directly to the page tree creates friction.

Page Tree Loops vs. ProcessWire Navigation

Section titled “Page Tree Loops vs. ProcessWire Navigation”
Requirement Page Tree Loop / Repeater ProcessWire Navigation
Different Menus for Header, Footer & Mobile Requires checkboxes (show_in_header, show_in_footer) scattered across templates. Dedicated menus (main, footer, mobile) with independent depth limits, permissions, and custom fields.
Deep Nesting & Passive Headings Repeaters cap usability at 1 to 2 levels; page trees require fake empty pages for section headers. Up to 10 nesting levels with native Heading, Divider, and Text passive items plus drag-and-drop and keyboard reordering.
Mixed Target Types Hardcoded conditionals for external URLs, anchors, mailto:, or Entries items. Unified page, url, entry, children, and passive node types plus pluggable NodeTargetResolverInterface adapters.
Live Status Sync & Caching Either uncached DB queries on every request or stale cached links to unpublished pages. Two-tier caching (WireCache + in-memory) that auto-invalidates when any linked Page or Entry is saved, moved, or unpublished.
Breadcrumbs & Schema.org Custom recursive parent loops and hand-written JSON-LD. $navigation->renderBreadcrumbs($page, ['menu' => 'main', 'schemaJsonLd' => true]) resolves menu trails and emits BreadcrumbList JSON-LD.
Migration & Environments Manual click-through recreation between staging and production. Versioned site/navigation/*.yaml schemas plus portable navigation:export / navigation:import JSON bundles.

Next steps