settings_schema.json
The settings_schema.json
file controls the organization and content of the Theme settings area of the theme editor. All setting selections in the theme editor are saved in settings_data.json.
You can reference any available setting values in Liquid through the global settings object.
Location
The settings_schema.json
file is located in the config
directory of the theme:
└── theme
...
├── config
| └── settings_schema.json
| ├── settings_data.json
| └── settings_presets.json
└── locales
Schema
The settings_schema.json
file is an array of objects that represent setting categories. Each object needs to have the following attributes:
Attribute | Description | Required |
---|---|---|
name | The name of the category of settings. | Yes |
settings | An array of associated settings. | yes |
You can create various categories of settings using the basic format below. The name
attribute determines the category, and the settings
attribute is an array of the associated settings:
The settings_schema.json
file should follow the following basic format:
[
{
"name": "Category",
"settings": [
...
]
},
...
]
The settings_schema.json
file is a JSON file, so all content must be valid JSON. Additionally, make sure you follow the appropriate syntax for your desired setting.
Usage
When working with the settings_schema.json
file, familiarize yourself with the following:
Setting types
There are two categories of settings:
Category | Description |
---|---|
Input settings | Settings that can hold a value, and are configurable by merchants. |
Sidebar settings | Settings that can’t hold a value, and aren’t configurable by merchants. They’re informational elements that can be used to provide detail and clarity for your input settings. |
Access settings
Theme settings can be accessed through the settings object. To learn more about the syntax and considerations, refer to Access settings.
Add theme metadata
As a theme author, you can include additional metadata for your theme.
To add this metadata, you can include a theme_info
object in the settings_schema.json
file. This object must include the following attributes:
Attribute | Description | Required |
---|---|---|
name | The value of this attribute must be theme_info . | Yes |
theme_name | The name of the theme. | Yes |
theme_author | The author of the theme | Yes |
theme_version | The version number of the theme. | Yes |
Example:
[
{
"name": "theme_info",
"theme_name": "Life Style",
"theme_author": "Shoplazza",
"theme_version": "1.0.0"
},
...
]
If a theme has no settings_schema.json file
If a theme has no settings_schema.json
file, then you can do one of the following:
- Create a new file from scratch as part of the initial theme development process
Create from scratch
If you create the file from scratch as part of the initial theme development process, then make sure you do the following:
- Save the file in the
config
directory - Check that your settings are formatted correctly
Updated over 2 years ago