Skip to content

settings_data.json ​

Last updated View as Markdown

config/settings_data.json stores the values behind the theme's settings schema, along with data for statically rendered sections. The theme editor reads and writes this file as sellers customize the theme; it ships with the theme to provide the starting configuration.

json
{
  "current": {
    "logo": "logo.png",
    "favicon": "favicon.png",
    "logo_width": 90,
    "cart_type": "drawer",
    "sections": {
      "announcement-bar": {
        "type": "announcement-bar",
        "settings": {}
      },
      "header": {
        "type": "header",
        "settings": {
          "logo_position": "left",
          "sticky_header_type": "on-scroll-up"
        }
      },
      "footer": {
        "type": "footer",
        "settings": { "show_social": true }
      }
    }
  },
  "presets": {
    "Default": {}
  }
}

Top-level properties ​

PropertyTypeRequiredDescription
currentobject | stringYesThe active configuration. An object holds the values directly; a string names a key in presets to use instead.
presetsobjectYesNamed theme styles, keyed by style name. "Default": {} is the common minimum.

A current (or preset) object has three kinds of content.

Theme setting values ​

Any key other than sections and blocks is a theme setting value, keyed by the setting id from settings_schema.json. Their values are available in the global settings object in Liquid.

json
"logo_width": 90,
"cart_type": "drawer"

Settings left out here fall back to the default declared in the schema.

sections ​

Data for statically rendered sections, keyed by a section ID. Each entry has the same shape as a section in a JSON template: type, settings, blocks, order, and disabled.

json
"sections": {
  "announcement-bar": {
    "type": "announcement-bar",
    "settings": { "auto_rotate": true },
    "blocks": {
      "block_one": {
        "type": "announcement_item",
        "settings": { "text": "Free shipping on all orders" }
      }
    },
    "order": ["block_one"]
  }
}

When a layout calls {% section 'announcement-bar' %}, the renderer looks up the entry whose type matches and renders the section with that data.

blocks ​

The app embeds of the theme, keyed by a block ID.

json
"blocks": {
  "65d73f2c147c78": {
    "type": "youcan://apps/app_FBnC3ZoRVW9hRwYQtVEQ3aa9ObH/extensions/ext_FBnCCFymYw0EexC4K7bqOfM8WSX/blocks/announcement-bar.liquid",
    "disabled": false,
    "settings": { "text": "Free shipping on all orders" }
  }
}
PropertyTypeRequiredDescription
typestringYesThe ID of the app block.
disabledbooleanNoWhen true, the embed is not rendered. Defaults to false.
settingsobjectNoValues for the embed settings, keyed by setting id. Settings left out get their default value.

Sellers turn app embeds on and off in the theme editor, and the changes are saved here. The embeds of an app that is not installed are kept, but they are not rendered.

Theme styles ​

Each entry in presets is a theme style. It holds a full set of setting values, for example for a light and a dark version of the theme. The presets are not changed when the seller edits the theme.

  • When current is a preset name, the preset is copied into current the first time the seller edits a setting. From then on, current is an object.
  • When a theme has two or more presets, they are listed under Theme style in the theme editor. When the seller picks one, its values are copied into current, and the settings that the preset leaves out are reset to their default. The sections of current are kept.
  • Every preset is validated with the same rules as current. A select or radio value that is not one of the options is accepted in settings_data.json.
json
{
  "current": "Light",
  "presets": {
    "Light": { "color_schemes": { "scheme-1": { "settings": { "background": "#FFFFFF", "text": "#121212" } } } },
    "Dark": { "color_schemes": { "scheme-1": { "settings": { "background": "#111827", "text": "#F9FAFB" } } } }
  }
}

Editing ​

In normal use the theme editor owns this file. Hand-edit it only to set up the configuration a theme ships with, and keep every setting id and section type aligned with settings_schema.json and the section files.