How can I reorder sections in a duplicated header liquid file?

Topic summary

Main issue: After duplicating a header Liquid file, attempting to reorder sections via the header-group JSON returns an error that the new section doesn’t exist. The goal is to have a secondary menu that changes based on the collection (e.g., Women’s vs. Men’s).

Key guidance provided:

  • Rename the duplicated header file so it has a unique filename. Then, inside its JSON, update the section’s name and id to unique values. After these changes, the new section reference can be used without the “doesn’t exist” error.

Context: The request aims to implement a collection-conditional secondary navigation, which may require separate header sections or logic tied to collection contexts.

Status: No confirmation of resolution. Next steps likely involve ensuring unique section identifiers and then applying conditional logic to swap menus per collection once the new header section is recognized.

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

Hello,

I am trying to reorder the sections within my theme code. I duplicated the header liquid file and tried to reorder using the header-group JSON but it says that the section I created doesn’t exist. Can someone help with this?

I may be going about this the wrong way. I am trying to create a secondary menu that is conditional based on collection. For example, I want the menu to change when you go from “Women’s” to “Men’s”. Thank you!

Hi @korrynf

This is Richard from PageFly - Shopify Page Builder App

You will need to change the file name of the one you duplicated.

And in that file, head to JSON, you need to change the name, id of the section too.

After that you can use it with the new name you’ve created

Hope this can help you solve the issue

Best regards,

Richard | PageFly