LiquidNavigation Menus

Navigation Menus

Menus a merchant builds under Navigation reach a template as linklists, keyed by the menu's handle, the same shape a Shopify theme expects. Declare a menu setting so the merchant can choose which menu a header, footer or section shows.

A menu, live

Hover a top-level link with children to open its dropdown. Open Settings to switch menus or choose none.

Menu bar
Playground
Loading editor…

Runs in your browser on sample data: the same engine and filters as the storefront. Widgets such as add to cart are simulated: clicking one shows what would happen on a store.

The objects

ObjectFields
linklists["<handle>"]handle · title · links[] · levels
linktitle · url · type · active · child_active · levels · links[] (children) · icon · badge · image · description
  • active is true on the current page; child_active when one of its descendants is.
  • levels is 0 for a leaf, 1 with children and 2 with grandchildren: enough for a mega menu.
  • type uses Shopify's names: collection_link, product_link, blog_link, heading_link, http_link and so on.
  • icon, badge, image and description are extras the merchant sets per item. Use them for a mega menu's images or a “New” pill.

The menu setting

A menu setting stores a handle. Look it up with brackets: {% assign menu = linklists[section.settings.menu_handle] %}. Handles contain hyphens, so linklists.main-menu does not work; use linklists["main-menu"].

Always have a fallback

A new store may have no menu assigned yet. Check menu.links.size > 0 and fall back to a few typed links, or nothing, rather than an empty bar.

Headers and footers

The theme's header and footer are Liquid too, and are the main users of menus. They appear on every page, so they should read only shop, linklists, settings and their own settings: product and collection are empty on most pages a header is shown on. Use the storefront widgets for the cart and search icons.

Still stuck? Our team reads every message.

Need help?