Start building

Guides

Shopify section presets: what they control, with before and after code

Three lines of JSON decide whether a merchant can find your section at all. A few more decide whether it arrives looking finished or empty.

The Klorr teamUpdated 7 min read

  • Schema
  • Presets
  • Theme editor
  • Blocks

Key takeaways

  • No presets means no entry in Add section. The file is still valid, but it has to be placed by hand in a JSON template and can't be removed in the editor.
  • A preset can carry settings and blocks, so a new section arrives filled in instead of empty.
  • Several presets in one file appear as several choices in the picker, which saves you from maintaining near-identical copies.
  • Presets apply at the moment of adding. Changing one later doesn't touch sections already on a page, since those values were saved in the template.

The same section, before and after

This schema saves without complaint and the file sits in sections/, yet nobody can add it from the theme editor:

schema.json
{
  "name": "Promo banner",
  "settings": [
    { "type": "text", "id": "heading", "label": "Heading", "default": "Heading" }
  ],
  "blocks": [
    {
      "type": "button",
      "name": "Button",
      "settings": [
        { "type": "text", "id": "label", "label": "Label", "default": "Shop now" },
        { "type": "url", "id": "link", "label": "Link" }
      ]
    }
  ]
}

And here is the same schema with one array added. Now it appears in Add section, and it arrives with a real heading and a button already in place:

schema.json
{
  "name": "Promo banner",
  "settings": [
    { "type": "text", "id": "heading", "label": "Heading", "default": "Heading" }
  ],
  "blocks": [
    {
      "type": "button",
      "name": "Button",
      "settings": [
        { "type": "text", "id": "label", "label": "Label", "default": "Shop now" },
        { "type": "url", "id": "link", "label": "Link" }
      ]
    }
  ],
  "presets": [
    {
      "name": "Promo banner",
      "settings": { "heading": "The winter edit is here" },
      "blocks": [
        { "type": "button", "settings": { "label": "Shop the edit" } }
      ]
    }
  ]
}

That's the whole mechanism. Shopify's docs put it this way: files without presets "should be included in the JSON file manually, and can't be removed using the theme editor." If your section is missing from the picker and this array is absent, you've found the cause. If the array is there and the section still doesn't show, this troubleshooting guide goes through the other causes.

Leaving presets out on purpose

A section without presets isn't always a mistake. Open Dawn and you'll find sections/main-page.liquid has none, while templates/page.json names it directly as the page's main section. That's deliberate: every page template needs that section, it would make no sense as a second copy, and merchants shouldn't be able to delete it. Multicolumn, on the other hand, is meant to be added anywhere, so its preset exists and comes with three column blocks.

You wantUse
Merchants can add it, move it and remove itpresets
It's fixed in one template and must always be thereNo presets, written into the template JSON
It's hard-coded in a layout or template with {% section 'name' %}default (or a default per setting), no presets

That last row is where people mix up the two keys. default has the same shape as a preset, but it applies when a section is statically rendered, and Shopify says sections with presets shouldn't be statically rendered. Statically rendered sections also can't be removed or reordered by merchants, which is usually a reason to avoid them.

What can go inside a preset

KeyRequiredWhat it does
nameYesThe label in the picker and the sidebar. It's also saved in the template
categoryNoGroups presets into collapsible categories in the picker. Uncategorized presets come first
settingsNoValues for the section's settings, overriding each setting's own default. An object keyed by setting id
blocksNoBlocks to start with. An array; each entry needs a type that exists in the schema, and can include settings and a display name

Notice the difference in shape: settings is an object ({ "heading": "…" }), while blocks is an array of objects. Mixing those up is the most common preset typo, along with using a setting id that doesn't exist or a block type the schema doesn't declare. Shopify checks presets against the schema when you save, so these tend to surface as a save error naming the preset. For errors that stop the file saving at all, see invalid JSON in schema.

Default blocks decide the first impression

A section built around blocks looks broken when it arrives empty, and an FAQ with no questions gives the merchant nothing to click on. Dawn's Multicolumn avoids this with a preset that creates three column blocks. Three is a good rule of thumb for repeating content: enough to show the layout at work, few enough to delete quickly.

Block settings inside a preset are optional. A block listed with only its type picks up each setting's default. So set good defaults in the block's schema first, and override them in the preset only where the copy should differ between blocks. Check the combined count against max_blocks too, since a preset with more blocks than the limit doesn't make sense. For block basics, see how to add blocks to a section.

Several presets, one file

This is the feature most themes underuse. Each entry in the array shows up as its own choice in Add section, and the theme editor generates a preview for each. So a single file can appear as "Promo banner: sale" and "Promo banner: new arrival", with different layouts and colors, and you fix bugs in one place. Presets appear alphabetically by name, so start names with the same word if you want them grouped together, or use category.

sections/promo-banner.liquid
<div id="promo-{{ section.id }}" class="promo promo--{{ section.settings.layout }}">
  {%- if section.settings.image != blank -%}
    <div class="promo__media">
      {{ section.settings.image | image_url: width: 1600 | image_tag:
        loading: 'lazy',
        widths: '600, 900, 1200, 1600',
        sizes: '(min-width: 750px) 50vw, 100vw'
      }}
    </div>
  {%- endif -%}
  <div class="promo__copy">
    <h2 class="promo__heading">{{ section.settings.heading | escape }}</h2>
    {%- if section.settings.text != blank -%}
      <div class="promo__text">{{ section.settings.text }}</div>
    {%- endif -%}
    <div class="promo__actions">
      {%- for block in section.blocks -%}
        <a class="promo__btn" href="{{ block.settings.link | default: routes.all_products_collection_url }}" {{ block.shopify_attributes }}>
          {{- block.settings.label | escape -}}
        </a>
      {%- endfor -%}
    </div>
  </div>
</div>

<style>
  #promo-{{ section.id }} { display: grid; gap: 24px; padding: 48px 20px; background: {{ section.settings.background }}; color: {{ section.settings.ink }}; }
  #promo-{{ section.id }} .promo__media img { display: block; width: 100%; height: auto; }
  #promo-{{ section.id }} .promo__heading { margin: 0 0 12px; color: inherit; }
  #promo-{{ section.id }} .promo__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
  #promo-{{ section.id }} .promo__btn { padding: 12px 22px; border: 1px solid currentColor; color: inherit; text-decoration: none; }
  #promo-{{ section.id }} .promo__btn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
  #promo-{{ section.id }}.promo--center { text-align: center; }
  #promo-{{ section.id }}.promo--center .promo__copy { max-width: 640px; margin: 0 auto; }
  #promo-{{ section.id }}.promo--center .promo__actions { justify-content: center; }
  @media (min-width: 750px) {
    #promo-{{ section.id }}.promo--split { grid-template-columns: 1fr 1fr; align-items: center; }
  }
</style>

{% schema %}
{
  "name": "Promo banner",
  "tag": "section",
  "max_blocks": 2,
  "settings": [
    { "type": "text", "id": "heading", "label": "Heading", "default": "Say what's on offer" },
    { "type": "richtext", "id": "text", "label": "Text" },
    { "type": "image_picker", "id": "image", "label": "Image" },
    {
      "type": "select",
      "id": "layout",
      "label": "Layout",
      "options": [
        { "value": "split", "label": "Image beside text" },
        { "value": "center", "label": "Centered" }
      ],
      "default": "split"
    },
    { "type": "color", "id": "background", "label": "Background", "default": "#f4f1ea" },
    { "type": "color", "id": "ink", "label": "Text color", "default": "#1c1c1c" }
  ],
  "blocks": [
    {
      "type": "button",
      "name": "Button",
      "settings": [
        { "type": "text", "id": "label", "label": "Label", "default": "Shop now" },
        { "type": "url", "id": "link", "label": "Link" }
      ]
    }
  ],
  "presets": [
    {
      "name": "Promo banner: new arrival",
      "category": "Promotions",
      "settings": { "layout": "split", "heading": "Name the new arrival", "background": "#f4f1ea", "ink": "#1c1c1c" },
      "blocks": [ { "type": "button", "settings": { "label": "See what's new" } } ]
    },
    {
      "name": "Promo banner: sale",
      "category": "Promotions",
      "settings": { "layout": "center", "heading": "Name your sale and its end date", "background": "#1c1c1c", "ink": "#ffffff" },
      "blocks": [
        { "type": "button", "settings": { "label": "Shop the sale" } },
        { "type": "button", "settings": { "label": "See all products" } }
      ]
    }
  ]
}
{% endschema %}

To try it, follow the install guide. You'll get a Promotions category in the picker holding both versions. A variant preset only changes starting values, so it can't add markup the file doesn't have. Anything that differs structurally needs a setting the Liquid responds to, which here is layout. If two presets would need very different Liquid, that's two sections.

When a preset exists but still doesn't show

  • enabled_on or disabled_on is excluding this spot. Dawn's Multicolumn has "disabled_on": { "groups": ["header", "footer"] }, so you won't find it in the footer picker however good its preset is. You can use only one of the two keys.
  • limit is reached. A section with "limit": 1 that's already on the template leaves the list.
  • The template is full. JSON templates and section groups can render up to 25 sections.
  • You're editing a different theme from the one you saved the file to. It happens to everyone, especially with a duplicate open in another tab.

What presets can't do after the fact

Once a merchant adds a section, its values live in the template's JSON. Editing the preset next month changes what future additions start with and leaves existing ones alone. If you're pushing a correction to many pages, you need to edit those sections directly or change the Liquid. It also means renaming a preset doesn't rename what's already placed, since the docs note the name is saved in the template.

Theme blocks follow a similar rule at their own level. A file in blocks/ also needs a preset to appear in the block picker, and its preset can arrange child blocks. If you aren't sure whether you're dealing with section blocks or theme blocks, the schema's blocks array tells you: { "type": "@theme" } means theme blocks. If you'd rather not type presets by hand, the schema generator builds and checks them in your browser.

Questions, answered

Why doesn't my section appear in Add section?

Most often the schema has no presets array. Add one with at least a name. If it has one, check enabled_on, disabled_on and limit, and confirm you saved to the theme you're editing.

What's the difference between default and presets in a Shopify schema?

presets are choices a merchant picks when adding a section to a JSON template. default has the same attributes but applies when a section is statically rendered with the section tag. Shopify says sections with presets shouldn't be statically rendered.

Can a section have more than one preset?

Yes. Each preset appears as its own option in Add section, with its own settings and blocks, while all of them share one file. They're listed alphabetically by name and can be grouped with category.

How do I add default blocks to a section?

List them in the preset's blocks array, each with a type matching a block declared in the schema. Add settings to any block whose values should differ from the schema's defaults.

If I edit a preset, do existing sections change?

No. A section's values are saved in the template when it's added, so a preset only affects sections added after the change.

Get the whole section written for you

Describe the section you want. Klorr writes the Liquid, the CSS, the schema and every theme-editor setting — code that lives in your theme and stays yours.