I already made two different menu bars, and I would like the second one to appear only on the product page and the first one on all the other pages. You probably already know that if you change the menu bar being used via the gui editor, it makes it appear not only on the page you want, but an all the pages.
It’s a lot that I’ve been trying to figure out how to make the second menu bar appear only on that one page, but so far I didn’t find the answer yet.
As of right now I’ve managed to make the two working menus on different .json files, and I found the place on the theme.liquid file where the .json file for the menu is called.
its all working until I add conditionals! I’ve tried everything but I cannot understand what I’m doing wrong: here’s the code section inside theme.liquid for what I want to do:
{%- if page.handle == 'multifunctional-liquid-shoe-brush-household-press' -%}
{% sections 'header-group-2' %}
{% else %}
{% sections 'header-group' %}
{%- endif -%}
Basically if I leave only {% sections ‘header-group’ %} or {% sections 'header-group-2} it works as intended, so I guess that the place where the code is located and the menus calling is correct. It’s just the if condition that doesn’t seem to work, because the menu I select still shows on all the website.