Skip to content

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

  1. Create site/navigation/main.yaml

    Scaffold with php vendor/bin/wire make:navigation main or copy site/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-2
    maxDepth: 3
    cacheTtl: 3600
    includeHiddenPages: false
    permission: navigation
    fields:
    subtitle:
    type: text
    label: "Subtitle / Promo Tagline"
    icon: typography
    useLanguages: true
    inheritLanguage: true
    columnWidth: 50
    badge_text:
    type: text
    label: "Badge Pill Text"
    icon: tag
    useLanguages: true
    inheritLanguage: true
    columnWidth: 50
  2. 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 --json
    php vendor/bin/wire navigation:list
  3. Render the menu and Schema.org breadcrumbs in your layout template

    In site/templates/_main.php, use $navigation (or wire()->navigation):

    <?php
    declare(strict_types=1);
    namespace ProcessWire;
    /** @var Page $page */
    /** @var Navigation $navigation */
    $navigation = wire()->navigation;
    // Accessible <nav> markup with Tailwind preset and inline vector SVG icons
    echo $navigation->render('main', [
    'preset' => 'tailwind',
    'maxDepth' => 3,
    'renderIcons' => true,
    'iconSize' => 18,
    ]);
    // Breadcrumb trail resolved from the 'main' menu + Schema.org BreadcrumbList JSON-LD
    echo $navigation->renderBreadcrumbs($page, [
    'menu' => 'main',
    'prependHome' => true,
    'homeLabel' => __('Home', __FILE__),
    'schemaJsonLd' => true,
    ]);
  4. 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

Next steps