Add navigation to your theme

Merchants can create menus for their shop navigation, and these menus can be nested to create drop down menus.

To create drop down menus, the admin allows merchants to nest menus within a single menu, however there was a time that this wasn’t possible. To learn more, refer to Legacy nested menus.

Output menus with Liquid

Outputting menus relies on the following Liquid objects:

  • linklists - A global object of all menus for the shop.
  • linklist - A menu object.
  • link - An individual link object inside a menu.

The linklists object is used to find the menu that you want to output, which is the Main menu by default. This menu can be accessed with it’s handle main-menu.

For example:

For each menu link, you’ll want to output things like the title, and the URL, however a link can also have child links. These nested links are limited to 3 levels, and are accessible through the links attribute of the link object.

For example: