Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
I have a problem with my menus, i have created two different menus lets call them women and kids. When i assign the menu kids to the kids page, the menu changes on all other pages like womens page. I want to use specific menu for each page. I have tried to look into the coding part but i cant find where i need to change the coding, closest i got to was it displayed both menus at the same time.
{% if customer.tags contains "wholesale" %} {% assign menu = 'wholesale-menu' %} {% else %} {% assign menu = 'normal-menu' %} {% endif %} {% for link in linklists[menu].links %} //code to output your menu items. {% endfor %}
maybe this code will work if i insert it into nav.liquid or header, but i need to change {% if customer.tags contains "wholesale" %} to something specific for the page
Hello
You can use
{% if page.handle contains "kids" %}
Kids menu
{% elsif page.handle contains "womens" %}
Womens menu
{% else %}
common menu
{% endif %}
Use your page handles, you can find it in your URL: myshopify.com/pages/page-handle
Thanks, which liquid file do i put this code into?
You can check where your menu code has been added. Maybe header.liquid or any nav.liquid file.
alright thanks, the womens page doesnt have handle since its the first page (home page) what do i write instead?
Use below code
{% if page.handle contains "kids" %}
Kids menu
{% else %}
common menu for all other pages
{% endif %}
I tried your code but then on my website i can only see the text kids menu on top not showing the actual menu. I tried this, i think you missed a part of code where it says assign, but this didnt have any effect on the site
{% if page.handle contains "kids" %}
{% assign menu = 'kids-menu' %}
{% else %}
{% assign menu = 'main-menu' %}
{% endif %}
No i haven't missed any code. You have to access your menu in between the conditions like below.
{% if page.handle contains "kids" %}
{% assign menu = 'kids-menu' %}
<ul>
{% for link in linklists[menu].links %}
<li>
<a href={{ link.url }}>{{ link.title }}</a>
</li>
{% endfor %}
</ul>
{% else %}
{% assign menu = 'main-menu' %}
<ul>
{% for link in linklists[menu].links %}
<li>
<a href={{ link.url }}>{{ link.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
Hello,
This code is perfect, but where should it be placed once I add it to the code, it shows double menus, the original one in place and this code to the upper left vertically
Did you find a solution to this? It's showing double menus for me also.
Thank you, I have been looking for this for ages, and looks like no one else knows how this should be done. Can I ask, If my "Pages" that need different menu are actually Categories and also Product - pages, instead of page.handle should I write category.handle and product.handle?
Hey @love666 ,
I know i'm bit late into it but please refer to the below video to implement the same.
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