How to Override header-group.json based on page variable (Url/Template/etc)

Topic summary

Goal: show different header navigation menus for corporate vs ecommerce pages in a Shopify (Dawn) theme.

Early attempt: duplicate header-group.json and conditionally render sections in theme.liquid based on template.name (e.g., product). Downsides: duplicated JSON doesn’t sync with theme customizer changes, requiring manual copy-paste.

Adopted approach:

  • Edit header.liquid schema to allow selecting two link_list menus (e.g., menu and menu2) in the customizer. “link_list” is a schema setting that lets a section reference a Shopify navigation menu; header-group.json stores these customizer settings.
  • If multiple link_list inputs are blocked (due to app blocks), remove the max_blocks line and the last blocks object to re-enable multiple link lists.
  • In header-dropdown-menu.liquid, create a variable (e.g., menuToLoad) based on template.name, then render links from menuToLoad instead of section.settings.menu.links. This worked on Dawn.

Optional robustness: add a third “control” menu containing pages that should use the corporate menu. Logic: if current page is in control menu, use menu2; otherwise, use menu1. This avoids expanding template checks.

Outcome: working solution with schema changes and conditional menu selection; images illustrate schema edits. Discussion concludes with improvements suggested; no unresolved disputes.

Summarized with AI on January 5. AI used: gpt-5.

Looking into this further I don’t think your solution is possible as the “link_list” that is the menu can only be referenced once:

I have looked applying some code where the actual handle for the menu gets applied to grab links from but form what I can tell (at least with the dawn theme) this happens across multiple snippets (header-dropdown-menu / header-drawer / header-mega-menu).

There must be an easy way to bake this in without having to create a duplicate?