Edit Index.json To Assign A Different Page As The Homepage

I wan’t to set the homepage to one of the static pages built in Shopify.

How should I be editing index.json to assign a different page as the homepage? The page name is /pages/landingpage

Many thanks in advance

Hi @mrenish ,
I have this idea by using a custom section:

  1. Create a new section file by going to the Sections folder in your Shopify theme and clicking on Add a new section. Name the section something like landing_section.liquid.

  2. In the landing_section.liquid file, add the following code to load the landing page content:

{% assign page = pages.landingpage %}
{{ page.content }}
  • Save the changes to the landing_section.liquid file.

  • In the index.json file, add the following code to load the landing_section:

{
  "sections": {
    "landing_section": {
      "type": "landing_section"
    }
  },
  "order": [
    "landing_section"
  ]
}
  • Save the changes to the index.json file.

  • Go to your Shopify admin dashboard and navigate to Online Store > Themes > Customize And check the result.

    If you want an easy-to-go alternative solution, you can use our Weaverse Section Builder app. This app allows you to create and manage custom sections in Shopify easily. With Weaverse, you can write custom HTML/Liquid code and add your landing page there, then publish and use it from the theme customizer. Using Weaverse can make managing your custom sections easier and create a custom homepage for your Shopify store.

Thank you that worked.
But I ran into another problem though. The homepage shows up no content. However the landing page was created as a template within the theme customization.

Do you see anything out of the line here?

Thank you again for your help

If your page uses a custom template, you can search for that template by the name starting with “page.allabtjune” in Theme => Edit Code, copy its content, and paste it to index.json.
If the file is in Liquid, you can paste it into the landing section that you’ve created.