navigation Object

Used inside of a navigation template, provides data about the current navigation menu being referenced by the template.

Attributes

Attribute Required Description
title Yes string Title of the navigation menu.
links Yes array Collection of link objects contained within the navigation menu.
var_name Yes string Variable name entered via navigation.json that identifies this navigation menu within the theme.
id Yes number ID of navigation menu.

Category

Contextual Objects

Description

The navigation object is only available within navigation menu templates.

The primary attribute that you’ll be accessing is navigation.links, a collection of link objects describing the pages linked from the navigation menu.

Each link object will also contain an attribute called children containing link objects that are children in the navigation menu.