The linklist object
The linklist
object has the following attributes:
linklist.handle
Returns the handle of the linklist.
linklist.levels
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:
Main Menu: 3
linklist.links
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>
linklist.title
Returns the title of the linklist.