Ad

How Can I Add A Specific Shopify Menu Programmatically?

- 1 answer

Say for example, I wanted to add a custom section within the page and I wanted to display a menu in that section.

Ad

Answer

You can use :

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

And change main-menu with your handle.

For example if you create a menu called Custom Navigation, your handle will be custom-navigation

And you will use :

{% for link in linklists.custom-navigation.links %}

You can find documentation about linklist object here

Ad
source: stackoverflow.com
Ad