To make it easier for merchants to customize your theme, you can use JSON to create settings that merchants can access through the [theme editor](https://help.shopify.com/en/manual/online-store/themes/customizing-themes/edit#theme-editor). You can provide settings at the theme, section, or block level. Settings can be fixed (such as informational elements) or interactive (such as a drop-down menu). Setting values can be static, or use [dynamic sources](/docs/storefronts/themes/architecture/settings/dynamic-sources) to render contextually appropriate values. Exposing settings makes your theme more customizable so it can better express a merchant's brand. It also can make your theme more flexible so that you can address various use cases for merchants. ## Subtypes There are two categories of settings: | Category | Description | | --- | --- | | [Input settings](/docs/storefronts/themes/architecture/settings/input-settings) | Settings that can hold a value, and are configurable by app users. | | [Sidebar settings](/docs/storefronts/themes/architecture/settings/sidebar-settings) | Settings that can’t hold a value, and aren’t configurable by app users. They’re informational elements that can be used to provide detail and clarity for your input settings. |

Input settings reference

Explore the interactive settings that you can add to your theme.

Sidebar settings reference

Explore the informational settings that you can add to your theme.

## Location You can create settings in the following places: - `config` > [`settings_schema.json`](#settings_schema-json) - Section files in the `sections` folder, using the [the section's `{% schema %}` tag](#section-schema) ```text └── theme ├── config | ├── settings_schema.json | ... ├── sections | ├── main_product.liquid | ├── another_section_file.liquid | ... ... ``` ### settings_schema.json The [settings_schema.json](/docs/storefronts/themes/architecture/config/settings-schema-json) file controls the content of the **Theme settings** area of the theme editor. Settings in this file translate to global theme settings, which can be accessed through the Liquid [settings object](/docs/api/liquid/objects/settings). ### Section schema The section `{% schema %}` tag is where you can create [section settings](/docs/storefronts/themes/architecture/sections/section-schema#settings) and [block settings](/docs/storefronts/themes/architecture/sections/section-schema#blocks). Those settings can be accessed through the `settings` attribute of the [`section` object](/docs/api/liquid/objects/section#section-settings) and [`block` object](/docs/api/liquid/objects/block#block-settings), respectively. ## Schema Settings are defined as a JSON `settings` attribute that's parented to the object that the settings apply to. This attribute accepts an array of settings.

## Usage When working with settings, you should familiarize yourself with the following: - [Translating settings](#translate-settings) - [Accessing setting values](#access-settings) - [Checking the setting value format](#check-the-format-of-the-setting-value) - [Using dynamic sources for settings](#dynamic-sources) - [Platform-controlled settings](#platform-controlled-settings) ### Translate settings You can translate [various attributes](/docs/storefronts/themes/architecture/locales/schema-locale-files#content) of the settings schema depending on the online store's [active language](https://help.shopify.com/manual/online-store/themes/customizing-themes/language/translate-theme#choose-a-language-for-your-theme). These translations are stored in [schema locale files](/docs/storefronts/themes/architecture/locales/schema-locale-files). ### Access settings Depending on where they were created, you can access settings through the following Liquid objects: - The [global `settings` object](/docs/api/liquid/objects/settings) - The [`section` object](/docs/api/liquid/objects/section#section-settings) - The [`block` object](/docs/api/liquid/objects/block#block-settings) > Note: > Settings from the `settings` object can be accessed in Liquid [theme assets](/docs/storefronts/themes/architecture#assets). To access a specific setting, append the `id` attribute of the associated setting to the object that you want to access. For example, if you had the following setting implemented in each Liquid object: ```json { "type": "text", "id": "message", "label": "Message", "default": "Hello!" } ``` Then the following Liquid would generate the following output:

### Check the format of the setting value When referencing settings, you should always check that the value is in the format that you expect. Any setting without an automatic default value could end up with no value, which translates to an empty [string](/docs/api/liquid/basics/types#string). For example, if you have a setting with an `id` of `message`, then the following Liquid would generate the following output depending on the value:

You can check whether a value is an empty string with the `blank` operator. For example: ```liquid {% unless settings.message == blank %} {{ settings.message }} {% endunless %} ``` #### Resource-based settings To avoid an empty string, check that the value is in the format that you expect. It's possible that no resource was selected, selected resource no longer exists, or the selected resource has been hidden. For example, if you have the following `page` type setting: ```json { "type": "page", "id": "page", "label": "Page" } ``` Then you can check for emptiness like the following: ```liquid {% if settings.page != blank %} {{ settings.page.title }} {{ settings.page.content }} {% else %} No page, or invalid page, selected. {% endif %} ``` > Tip: > Resource-based settings didn't always return the resource object. To learn more, refer to [Legacy resource-based settings](#legacy-resource-based-settings). #### Legacy resource-based settings In the past, resource-based settings returned the handle of the associated resource, and you had to access the actual object through Liquid using that handle. For example, if you had the following product setting, then you would need to access the product object like the following:

### Dynamic sources Settings for sections and blocks included in a [JSON template](/docs/storefronts/themes/architecture/templates/json-templates) have the option for merchants to [connect one or more dynamic sources to the setting](https://help.shopify.com/manual/metafields/displaying-metafields-on-your-online-store#connecting-metafields-to-your-theme-by-using-the-theme-editor), depending on the setting type. [Learn more about dynamic sources](/docs/storefronts/themes/architecture/settings/dynamic-sources). ### Platform-controlled settings In the theme editor, Shopify exposes a [custom CSS setting](https://help.shopify.com/manual/online-store/themes/theme-structure/extend/add-css) at the theme and section level. You can't add or hide this setting in your settings schema. Any custom CSS that merchants add using this setting is stored in a `custom_css` attribute, either in a JSON template's [section attribute](/docs/storefronts/themes/architecture/templates/json-templates#schema), or in the [settings_data.json](/docs/storefronts/themes/architecture/config/settings-data-json) `platform_customizations` object. This setting is intended to enable users to customize the look and feel of their storefront without editing theme code. As a theme developer, you shouldn't add this setting, or edit the value of this setting after it's set. Instead, you should use dedicated [CSS assets](/docs/storefronts/themes/architecture#assets) and [`stylesheet` Liquid tags](/docs/storefronts/themes/architecture/sections/section-assets#stylesheet), and introduce customization options for CSS in these areas using [theme settings](/docs/storefronts/themes/architecture/settings).