Different Menus for Different Set of Pages

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’ %}


    {% for link in linklists[menu].links %}

  • <a href={{ link.url }}>{{ link.title }}

  • {% endfor %}

{% else %}
{% assign menu = ‘main-menu’ %}

    {% for link in linklists[menu].links %}

  • <a href={{ link.url }}>{{ link.title }}

  • {% endfor %}

{% 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?