Liquid Template Variables - linklist

From Spiffy Stores Knowledge Base

The Liquid template variable linklist has the following attributes:

linklist.id

Returns the unique internal number of the linklist.

This is normally only for internal usage.

linklist.handle

This is the linklist handle.

linklist.title

Returns the title of this linklist.

linklist.links

Returns a collection of this linklist's links.

linklist.links_count

Returns the number of child links.

linklist.menu

Returns the HTML code for a fully generated tree-structured menu, using drop-down menus.

<div id="navigation">
  {{ linklists.main-menu.menu }}
</div>

This example includes all the code needed to implement a drop down menu.

The class active is added to the link automatically whenever a link is active.

linklist.menu_simple

Returns the HTML code for a simple tree-structured menu, using nested unordered lists.

<div id="side-navigation">
  {{ linklists.side-menu.menu_simple }}
</div>

The class active is added to the link automatically whenever a link is active.

linklist.menu_options_for_select

Returns the HTML code fragment required to render a tree-structured menu as a series of options for a select box. The items in the select box are indented to visually show the tree-structure of the menu. The code fragment consists of option tags, and would need to be included as part of a select tag.

<div id="mobile-navigation">
  <select name="main_navigation" id="main_navigation" class="fl" onchange="window.document.location.href=this.options[this.selectedIndex].value;">
    {{ linklists[settings.top_menu].menu_options_for_select }}
  </select>
</div>

Further Reference