You are viewing beta documentation for Navigation 4.x.
Menus

Node Types

Each node has a type that controls how it links, renders, and behaves in the menu builder. Types are PHP classes in verbb\navigation\nodetypes\.

Element-backed types

Link to Craft elements. Title and URL come from the linked element unless overridden.

TypeLinks to
EntryEntries
CategoryCategories
AssetAssets
ProductCommerce products (when Commerce is installed)

Structural and URL types

TypePurpose
CustomManual URL (internal or external)
PassiveNon-link label / dropdown trigger — renders as <span> by default
SitePoints at a site base URL; active for sub-pages on that site
GroupColumnMega-menu column wrapper — structural, no URL
DynamicProjects elements from a registered source at read time (see below)

Dynamic

A Dynamic node does not store child nodes for every matching element. At read time, Navigation projects matching elements as ProjectedNode children (stored manual children appear first, then projected items).

Choose a source when adding or editing the node. Built-in sources:

HandleProjects
entrySectionEntries from a channel or structure section
categoryGroupCategories from a category group
assetVolumeAssets from a volume
productTypeCommerce products from a product type (when Commerce is installed)

Configure source-specific settings (conditions, sort order, and so on) in the node slide-out.

Third-party plugins can register additional sources via RegisterDynamicSourceEvent. See Projected Node for template and GraphQL behaviour.

Passive and group rendering

Passive and group nodes use getTag() (usually span) instead of an anchor. See Custom Rendering.

Custom node types

Register your own types for specialised link behaviour. See Node Types.