Two Landingpages with differnt menus

Two Landingpages with differnt menus

cordu-1
Visitor
1 0 0

Hi,
I´m working with the dawn theme and I want to create two landing pages for different customers with different menus..
Therefore I created a new template at the code editor.

It shows to the main menu:
{
"sections": {
"main": {
"type": "main-page",
"settings": {
"padding_top": 28,
"padding_bottom": 28
}
}
},
"order": [
"main"
]
}

How do I have to change the code that the menu-a will be shown at the page.
Kind regards
Cordu

 

Reply 1 (1)

MandasaTech
Shopify Partner
790 154 166

Hi @cordu-1 

you’ll need to follow these steps:

Step 1: Add a Custom Header Section (If Needed)

If you want to assign a different menu only for this page, you’ll likely need to create a duplicate of your header section and assign a different menu to it.

  1. Go to Sections and duplicate header.liquid
    Name it something like header-alt.liquid.

  2. In header-alt.liquid, look for the line where the menu is assigned — typically something like this:

    {% assign main_menu = section.settings.menu %}

    You can either:

    • Hard-code your custom menu:

      {% assign main_menu = linklists.menu-a.links %}
    • Or add a new setting in schema to choose a custom menu from the editor.

Step 2: Modify Your Template

In your new JSON template (e.g., page.alt.json), include your custom header:

{
  "sections": {
    "custom-header": {
      "type": "header-alt"
    },
    "main": {
      "type": "main-page",
      "settings": {
        "padding_top": 28,
        "padding_bottom": 28
      }
    }
  },
  "order": [
    "custom-header",
    "main"
  ]
}

Step 3: Assign the Template

Go to the Pages section in your Shopify admin, open the landing page, and assign it the new template (e.g., page.alt).


Let me know if you have any issue with this.

 

☞ Helpful or Question answered? Please Click Like & Mark it Accepted Solution
☞ Want to modify or custom changes on store for affordable price? Click on Contact button here
☞ Email at experts@mandasa.in
☞ Whatsapp at +918989609120 | Hire us at: Website Support Page
☞ Selling Shopify Fundamentals: Verified Skill Badge