5-Minute Quickstart
This walkthrough sets up the Aegean Voyages (aegeanvoyages.example) primary header menu and breadcrumbs. All files shown here are ready to copy from site/modules/Navigation/examples/real-world/.
-
Create
site/navigation/main.yamlScaffold with
php vendor/bin/wire make:navigation mainor copysite/modules/Navigation/examples/real-world/main.yaml:title: "Main Header Navigation"description: "Primary Aegean Voyages header bar with 3-level dropdowns, icons, and seasonal promo badges."icon: menu-2maxDepth: 3cacheTtl: 3600includeHiddenPages: falsepermission: navigationfields:subtitle:type: textlabel: "Subtitle / Promo Tagline"icon: typographyuseLanguages: trueinheritLanguage: truecolumnWidth: 50badge_text:type: textlabel: "Badge Pill Text"icon: taguseLanguages: trueinheritLanguage: truecolumnWidth: 50 -
Populate items in Setup -> Navigation (or import the seed JSON)
You can add items visually in Setup -> Navigation using + Add Item, or import the Aegean Voyages starter bundle from the terminal:
Terminal window php vendor/bin/wire navigation:import site/modules/Navigation/examples/real-world/navigation-seed.json --mode=upsert --jsonphp vendor/bin/wire navigation:list -
Render the menu and Schema.org breadcrumbs in your layout template
In
site/templates/_main.php, use$navigation(orwire()->navigation):<?phpdeclare(strict_types=1);namespace ProcessWire;/** @var Page $page *//** @var Navigation $navigation */$navigation = wire()->navigation;// Accessible <nav> markup with Tailwind preset and inline vector SVG iconsecho $navigation->render('main', ['preset' => 'tailwind','maxDepth' => 3,'renderIcons' => true,'iconSize' => 18,]);// Breadcrumb trail resolved from the 'main' menu + Schema.org BreadcrumbList JSON-LDecho $navigation->renderBreadcrumbs($page, ['menu' => 'main','prependHome' => true,'homeLabel' => __('Home', __FILE__),'schemaJsonLd' => true,]); -
Clear cache after structural YAML edits
Whenever you add new YAML files or edit custom
fields:definitions, clear the registry cache:Terminal window php vendor/bin/wire navigation:clear --json