Use a different menu for a different page

Topic summary

A Shopify store owner using the Flex theme wants to display a custom navigation menu (“blender-menu”) on specific pages—a landing page and collection page both titled “Blender”—instead of the default main menu.

Current Approach:

  • The user has Liquid code with an {% if page.handle contains "Blender" %} conditional statement to switch menus based on page handle.
  • They’re uncertain where to insert this code within the header-classic.liquid file.

Key Questions:

  • Should the code modify the schema settings (the “Navigation” section with main_linklist)?
  • Or should it be placed within the existing <nav> element that renders menu items?

Response Provided:

  • Another user confirmed the logic is correct and mentioned implementing similar collection-based navigation changes.
  • They referenced a YouTube tutorial for the DAWN theme as a potential guide, though the original poster uses a different theme.

Status: The discussion remains open with implementation details unresolved for the Flex theme specifically.

Summarized with AI on November 11. AI used: claude-sonnet-4-5-20250929.

I am a novice atm when it comes to editing liquid. I am trying to have a different menu for a page based off the page title. I am using the Flex theme from out of the sandbox.

A brand lets call them blender, redirects a customer to my site, that customer lands on a page titled “blender” I would like the blender page AND the blender collection page to have a menu with the handle “blender menu” instead of my main menu.

I would assume I need to edit the header-classic.liquid file with an IF statement, I found this code from @Savior bellow that I believe should work for this, but im not sure where to put it.

{% if page.handle contains “Blender” %}

{% assign menu = ‘blender-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 %}

Is this below code what I should edit to achieve this?

“type”: “header”,
“content”: “Navigation”
},
{
“type”: “link_list”,
“id”: “main_linklist”,
“label”: “Main menu”,
“default”: “main-menu”
}

Or would i place it somewhere in here?

{% assign main_menu = linklists[section.settings.main_linklist] %} {% for link in main_menu.links %} {% if link.links == blank %} {% else %}
{{ link.title }} {% render 'header__dropdown-menu', link: link, index: forloop.index %}
1 Like

Hi @rowboat ,

Your code seems to be right but placed of that would depend which theme you are using to do. We have implement the same logic which change the navigation based on collection used for DAWN theme.

Request you to refer to the below video to implement the same.

Don’t forgot to like and mark as solution if it helps…