Ad

Shopify Reorder Sections And Editable Content?

- 1 answer

I'm trying to define the schema so my sections can be edited and reordered in the admin. I have this at the bottom of two of my section.liquid files.

{% schema %}
{
  "presets": [
    {
      "category": "Custom Content",
      "name": "Text",
      "settings": {
        "heading": "Hello World"
      }
    }
  ]
}
{% endschema %}

When I keep the "heading": "Hello World" I get the error

Status: 422 Unprocessable Entity Errors: Invalid preset "Text": cannot add settings because there are no settings defined in the schema.

I'm not entirely sure where else I need to define the settings?

Also when I get rid of the settings section "heading": "Hello World" it saves but the sections can't be reordered, I thought that was enabled when the "presets" part is in the schema?

Ad

Answer

Part of code is missing. Before defining preset values for settings you'll need to define settings themselves as explained in documentation here: https://help.shopify.com/themes/development/theme-editor/sections#settings

HTH

Ad
source: stackoverflow.com
Ad