C o d e V i b e
  • codeevibe@gmail.com
  • 8377927516
logo
  • Home
  • Free Section
  • Shopify Advance Section
  • About
  • Contact Us
Get A Quote
logo
  • 8377927516
  • codeevibe@gmail.com
shape
shape
shape

how-to-show-a-different-header-menu-for-different-collections-pages

How to Show a Different Header Menu for Different Collections pages
  • By CodeVibe
  • 15 Jul, 2025
  • Shopify free code

How to Show a Different Header Menu for Different Collections pages

Creating a tailored experience for your customers is essential in eCommerce, and one of the most effective ways to achieve this is by customizing your store's header menu based on the collection being viewed. Shopify allows store owners to create unique templates for different collections, enabling different navigation menus on each one.

In this article, we’ll walk you through how to set this up step-by-step using custom collection templates and theme code edits.

 

Why Use Different Menus for Different Collections?

Using different menus for each collection can improve:

  • User experience by showing relevant links based on the product category.

  • Conversions by guiding users to the most relevant subcategories or offers.

  • SEO through better internal linking.

  • Clarity and engagement on mobile, where minimal but targeted navigation is ideal.

For example:

  • On a clothing collection, the menu might include: Men, Women, T-Shirts, Jeans.

  • On an accessories collection, the menu might include: Watches, Jewelry, Bags, Sale.

 

 

How to Set Up Dynamic Menus by Collection

Step 1: Create a Custom Collection Template

  1. Go to Online Store → Themes → Edit Code.

  2. Under the Templates folder, click “Add a new template”.

  3. Select Collection and give your template a name, e.g., custom-menu.

  4. Shopify will create a new file like collection.custom-menu.json.

This new template will be used to show a custom menu for specific collections.

 

 

Step 2: Edit Header Files to Support Custom Menus

Next, you’ll modify the theme's header files to render a different menu based on the collection template.

  1. Open the following files:

    • header.liquid

    • header-drawer.liquid

    • header-mega-menu.liquid

  2. In each of these files, find the loop where menu items are rendered (usually something like section.settings.menu.links).

  3. Replace this with logic that checks for the template and loads a different menu. For example:

 

 

{% if template.suffix == 'custom-menu' %}
  {% assign new_menu = linklists['custom-menu-handle'].links %}
{% else %}
  {% assign new_menu = section.settings.menu.links %}
{% endif %}

 

Then use new_menu inside the for loop to render menu items.

  4.Repeat this change in all three header files and save your changes.

 

 

Step 3: Create Your Custom Menu

  1. Go to Navigation in your Shopify Admin.

  2. Create a new menu (e.g., “Custom Menu”).

  3. Add the desired links to this menu.

  4. Take note of the menu handle (usually auto-generated from the menu name, like custom-menu).

This handle is used in the code above.

 

 

Step 4: Assign the Template to a Collection

  1. Go to Products → Collections.

  2. Open the collection you want to apply the custom menu to.

  3. In the Theme template dropdown, choose your new template (e.g., collection.custom-menu).

  4. Save the collection.

 

When you now visit the collection page with the assigned template, you should see a different menu rendered based on your configuration. On all other collections or pages using the default template, the standard menu will continue to appear.

This creates a personalized browsing experience for each product category, increasing usability and engagement.

Search
Category
  • Shopify free code (9)
  • Horizen update (1)
  • Shopify free section (2)
  • Shopify Advance Section (4)
Recent Post
  • How to Add a Shoppable Banner in Shopify | Step-by-Step Tutorial
    04 Nov, 2025
    Keep Your How to Add a Shoppable...
  • How to Show Variant Wise Images in Shopify (Dawn Theme Custom Feature 2025)
    21 Oct, 2025
    Keep Your How to Show Variant Wise...
  • How to Create a Custom Email Signup Popup with 10% Discount Code in Shopify: Boost Sales in 2025How to Create a Custom Email Signup Popup with 10% Discount Code in Shopify: Boost Sales in 2025
    21 Oct, 2025
    Keep Your How to Create a Custom...
  • How to Add Google Sign-In to Your Shopify Store in 2025
    21 Oct, 2025
    Keep Your How to Add Google Sign-In...
  • How to Add a Mobile Bottom Menu in Shopify (App-Like Navigation Bar) – 2025 Guide
    21 Oct, 2025
    Keep Your How to Add a Mobile...
shape
shape
shape
shape
shodow
image

We help brands scale with custom Shopify solutions – from store setup to advanced app integration. At CodeVibe, we turn your e-commerce vision into reality.

Advance Sections

  • Home
  • Shopify free code
  • Horizen Updates
  • Shopify Free section

Important Links

  • Disclaimer
  • Privacy Policy
  • Terms & Conditions

Shopify Sections

  • Contact us
  • About Us
  • Blogs

Contact Us

North Ghaziabad 37455, India

  • Phone Call:

    8377927516

© All Copyright 2026 by CodeVibe