Navigation Menu HTML Objects

When working in navigation templates the {{ menu }} variable is actually a HTML Object. This makes it easy to alter the menu class or menu id value before outputting them.

{% set menu.class = menu.class ~ ' myMenuClass' %}

<ul{{ menu.class.attr }}{{ menu.id.attr }}>
</ul>

Available menu attributes

The following attributes are available for you to work with. Other {{ menu }} values are either strings or arrays and cannot be manipulated like the attribute values can.

{{ menu.class }}
{{ menu.id }}

See HTML Objects for more information about setting and displaying attribute values.