Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
I need to have a different menu based on a page variable, I don't know how to insert this variable into the for loop, for example:
{% assign menus = aggregate-menu %}
{%- for link in linklists.menus.links -%}
aggregate-menu is the menu handle.
How can I insert the menus variable? I have tried many solutions but none are effective
Solved! Go to the solution
This is an accepted solution.
Hi Delio,
Please try to update like this:
{% assign menus = 'aggregate-menu' %}
{%- for link in linklists[menus].links -%}
...
Also, you can see documentation here: https://shopify.dev/docs/api/liquid/objects/linklist
This is an accepted solution.
Hi Delio,
Please try to update like this:
{% assign menus = 'aggregate-menu' %}
{%- for link in linklists[menus].links -%}
...
Also, you can see documentation here: https://shopify.dev/docs/api/liquid/objects/linklist
It works, thank you!
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025