Link Search Menu Expand Document

Menu Item

object

The Item object can be accessed on the Menu object as below.

{% for item in menu.items %}
    <a href="{{ item.path }}">{{ item.label }}</a>
{% endfor %}


Attributes

item.label

string

The label for the menu item.

item.linked_resource

Page or Product or Blog post

The object associated with the menu item, if there is one. This can be one of the following:

You can use the type attribute to distinguish between these. For example:

{% case item.linked_resource.type %}
{% when "page" %}
    ...
{% when "experience" %}
    ...
{% when "accommodation" %}
    ...
{% when "blog_post" %}
    ...
{% endcase %}

It will return nil if the menu item uses an external URL.

item.new_tab

boolean

Returns true if clicking this item should open a new tab.

item.path

string

deprecated

The target url for the menu item.

This is deprecated as it will return a full URL. Use item.url instead.

item.url

string

The target url for the menu item.