All things Shopify and commerce
I'm using the Dawn theme to create a site that has B2C and B2B menus. The home page is the B2C landing page with B2C menu. They can click a link that will take them to a B2B landing page and I need to have a different menu for that. Both menus have sub pages.
I've tried the following code in the header.liquid section:
{% if page.handle contains "business-to-business" %}
{% assign menu = 'b2b-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 %}
That works, but it obviously creates a new, non-stylized menu ontop of the standard menu. Is there a way to call out the B2B menu in a different file so it just replaces the standard menu for the B2B pages? Or do I need to paste over code within the header.liquid?
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024