The linklist object

Tip

linklist objects are called "menus" in the Navigation page of the Shopify admin.

The linklist object has the following attributes:

Returns the handle of the linklist.

Returns the number of nested levels that a linklist contains.

For example, given the following main menu structure:

Main Menu
  └ Home
  └ About Us
    └ Locations
      └ Montreal
      └ Ottawa

The following Liquid code:

{% assign menu = linklists.main-menu %}
{{ menu.title }}: {{ menu.levels }}

produces the following output (edited for space):

Main Menu: 3

Returns an array of links in the linklist.

Input

{% for link in linklists.main-menu.links %}
      <a href="{{ link.url }}">{{ link.title }}</a>
{% endfor %}

Output

<a href="/">Home</a>
<a href="/collections/all">Catalog</a>
<a href="/blogs/news">Blog</a>
<a href="/pages/about-us">About Us</a>

Returns the title of the linklist.

Want to discuss this page?

Visit the Shopify Community