← Back to guides
Worked exampleShopify SectionsTutorial · Published 2026-11-21 · 5 min read

How to Add a Custom Section to Any Shopify Page (JSON Templates Explained)

You wrote a custom section. Now how does it appear on the home page, a product page or a collection? A clear guide to JSON templates, presets and the theme editor.

Share with Shopify developers — useful guides spread faster in theme dev communities.

The problem this solves

A very common question from people new to Online Store 2.0 is: "I created a section file, so why can't I see it on my page?" The answer is almost always one of three things: the section has no preset, it is not listed in the page's template, or the page type does not allow it. Once you understand how a page is assembled, all three are easy to fix.

How a Shopify page is assembled

In an Online Store 2.0 theme, each page type has a template stored in the templates folder. Most are JSON files such as index.json (home page), product.json and collection.json. A JSON template does not contain markup. It only lists which sections appear and in what order.

{
  "sections": {
    "hero": {
      "type": "hero-banner",
      "settings": { "heading": "Summer sale" }
    },
    "featured": {
      "type": "featured-collection",
      "settings": {}
    }
  },
  "order": ["hero", "featured"]
}

Read this top to bottom. The sections object gives each placed section a unique key (hero, featured). The type value is the filename of the section in the sections folder, without the .liquid extension. The order array controls the sequence on the page. A section that exists as a file but is missing from order will not render.

Two ways to put a section on a page

This is how merchants do it and it edits the JSON file for you.

  1. Open Online Store, Themes, then Customize.
  2. Use the page selector at the top to choose the page, for example Home page.
  3. In the left sidebar click Add section.
  4. Pick your section from the list. If it is not there, see the troubleshooting list below.
  5. Drag it to the position you want and click Save.

2. Edit the JSON template by hand

Developers sometimes do this to seed a new page type or a default layout. Add an entry under sections and add its key to order. For example, to add a new hero banner at the top of index.json:

{
  "sections": {
    "new_hero": { "type": "hero-banner", "settings": {} },
    "featured": { "type": "featured-collection", "settings": {} }
  },
  "order": ["new_hero", "featured"]
}

The key (new_hero) can be any unique string. The type must match your section filename exactly, including hyphens. A typo here is the most frequent reason a hand-edited template shows nothing.

Why a section does not show in "Add section"

If you open Add section and your section is not in the list, work through this checklist in order.

  1. Missing preset. A section appears in the list only if its schema contains a presets array. Add "presets": [{ "name": "My section" }] and save.
  2. Invalid schema. Broken JSON stops the section from loading. Check for trailing commas, missing quotes and duplicate setting ids.
  3. The section is restricted. A schema can use "enabled_on" or "disabled_on" to limit the page types. If your schema says "enabled_on": { "templates": ["product"] }, it will not show on the home page.
  4. Wrong theme. You may have edited a different theme from the one open in the editor. Confirm the theme name at the top of the code editor.
  5. Cached editor. Hard-refresh the theme editor after saving a new section file.

Presets and default settings

A preset can also pre-fill settings and blocks, so a merchant gets a good starting layout the moment they add the section.

"presets": [
  {
    "name": "FAQ list",
    "settings": { "heading": "Frequently asked questions" },
    "blocks": [
      { "type": "question" },
      { "type": "question" },
      { "type": "question" }
    ]
  }
]

Here the merchant receives a section with three empty question blocks ready to fill in. For more on this idea see our guide to presets that save merchant time.

Limiting where a section can appear

Sometimes a section only makes sense on one page type, like a size chart on a product page. Use enabled_on in the schema:

{% schema %}
{
  "name": "Size chart",
  "enabled_on": { "templates": ["product"] },
  "settings": [],
  "presets": [{ "name": "Size chart" }]
}
{% endschema %}

Now the section is offered on product pages and hidden everywhere else, which keeps the editor tidy for merchants. Use only one of enabled_on or disabled_on in a single schema.

Sections that appear on every page

Headers, footers and announcement bars are not part of a page template. They live in section groups (header-group.json and footer-group.json) and are loaded from layout/theme.liquid with the {% sections 'header-group' %} tag. If you want a banner on every page, add it to a section group, not to each template.

A quick testing routine

  1. Duplicate the live theme and work on the copy.
  2. Add your section file and confirm it appears in Add section.
  3. Place it on a test page and edit every setting to confirm each field changes the preview.
  4. Test mobile and desktop widths in the editor preview.
  5. Add the section twice on the same page to confirm the CSS is properly scoped.
  6. Publish the copy only when everything passes.

Summary

A section file does nothing until a template references it. Add a preset so merchants can add it from the editor, make sure the JSON is valid, and use enabled_on to control where it appears. If you are starting from plain HTML, the converter generates the settings and a preset for you, and our worked conversion example shows how the pieces fit together.

Need a hand?

If a section behaves differently in your theme, send us the code and the theme name through the contact form. You can also read about the developers behind this site on the Meet the founders page.

Topic cluster

Shopify Sections

OS 2.0 sections, JSON templates, and section architecture.

Convert your HTML to Shopify Liquid

Paste a module, generate Liquid + schema, then copy the result into your theme. Free to try—no signup required for a sample conversion.

Share

Share this guide

Found this guide useful? Share it with other Shopify developers on LinkedIn, X, or Reddit.