Skip to content

Settings Schema

The settings_schema.json file defines all configurable settings for your theme. These settings appear in the Basker CMS admin panel, allowing editors to customize the theme without modifying code.

The settings schema must be placed at:

your-theme/
└── config/
└── settings_schema.json

The settings schema is a JSON array containing:

  1. A theme metadata object (first item)
  2. One or more setting group objects
[
{
"name": "theme_settings",
"theme_name": "My Theme",
"theme_version": "1.0.0",
"theme_author": "Your Name"
},
{
"name": "header",
"type": "group",
"fields": [...]
},
{
"name": "footer",
"type": "group",
"fields": [...]
}
]

The first object in the array defines theme metadata. This information is displayed in the CMS when managing themes.

PropertyTypeDescription
namestringMust be "theme_settings"
theme_namestringDisplay name of the theme
theme_versionstringSemantic version (e.g., "1.0.0")
theme_authorstringTheme author name
theme_documentation_urlstringURL to theme documentation
theme_support_urlstringURL for support inquiries

Example:

{
"name": "theme_settings",
"theme_name": "Starter Theme",
"theme_version": "1.0.0",
"theme_author": "Your Company",
"theme_documentation_url": "https://docs.example.com",
"theme_support_url": "https://support.example.com"
}

Settings are organized into groups. Each group appears as a collapsible section in the admin panel.

{
"name": "header",
"label": "Header Settings",
"type": "group",
"fields": [
{
"type": "text",
"name": "logoText",
"label": "Logo Text"
}
]
}
PropertyTypeRequiredDescription
namestringYesUnique identifier for the group
labelstringNoDisplay label (defaults to name)
typestringYesMust be "group"
fieldsarrayYesArray of field definitions

Settings are available via the global settings object in Liquid templates:

{# Access by group and field name #}
{{ settings.header.logoText }}
{{ settings.footer.background }}
{{ settings.social.facebook_link }}
{# Use in conditionals #}
{% if settings.header.showAnnouncement %}
<div class="announcement">
{{ settings.header.announcementText }}
</div>
{% endif %}
{# Loop through arrays #}
{% for link in settings.footer_links %}
<a href="{{ link.href }}">{{ link.text }}</a>
{% endfor %}

Here’s a comprehensive settings schema example:

[
{
"name": "theme_settings",
"theme_name": "Starter Theme",
"theme_version": "1.0.0",
"theme_author": "Your Company"
},
{
"name": "header",
"label": "Header",
"type": "group",
"fields": [
{
"type": "upload",
"name": "logo",
"label": "Logo",
"relationTo": "media"
},
{
"type": "text",
"name": "donateLink",
"label": "Donate Button URL",
"default": "/donate"
},
{
"type": "checkbox",
"name": "showAnnouncement",
"label": "Show Announcement Bar",
"default": false
},
{
"type": "text",
"name": "announcementText",
"label": "Announcement Text"
},
{
"type": "color",
"name": "background",
"label": "Background Color",
"default": "#FFFFFF"
}
]
},
{
"name": "footer",
"label": "Footer",
"type": "group",
"fields": [
{
"type": "color",
"name": "background",
"label": "Background Color",
"default": "#1a1a1a"
},
{
"type": "color",
"name": "foreground",
"label": "Text Color",
"default": "#ffffff"
},
{
"type": "richtext",
"name": "copyrightText",
"label": "Copyright Text"
}
]
},
{
"name": "footer_links",
"label": "Footer Links",
"type": "array",
"fields": [
{
"type": "text",
"name": "text",
"label": "Link Text"
},
{
"type": "text",
"name": "href",
"label": "Link URL"
}
]
},
{
"name": "social",
"label": "Social Media",
"type": "group",
"fields": [
{
"type": "text",
"name": "facebook_link",
"label": "Facebook URL"
},
{
"type": "text",
"name": "instagram_link",
"label": "Instagram URL"
},
{
"type": "text",
"name": "twitter_link",
"label": "X (Twitter) URL"
},
{
"type": "text",
"name": "youtube_link",
"label": "YouTube URL"
},
{
"type": "text",
"name": "linkedin_link",
"label": "LinkedIn URL"
}
]
},
{
"name": "global",
"label": "Global Settings",
"type": "group",
"fields": [
{
"type": "upload",
"name": "fallbackImage",
"label": "Fallback Image",
"relationTo": "media"
},
{
"type": "text",
"name": "googleAnalyticsId",
"label": "Google Analytics ID"
}
]
}
]
TypeDescriptionDefault Value
textSingle-line text input""
textareaMulti-line text input""
numberNumeric input0
checkboxBoolean togglefalse
selectDropdown selectionFirst option
radioRadio button groupFirst option
colorColor picker"#000000"
TypeDescription
richtextRich text editor with formatting
codeCode editor with syntax highlighting
jsonJSON editor
TypeDescriptionRequires
uploadMedia file selectionrelationTo
relationshipLink to other contentrelationTo
TypeDescription
groupGroups related fields
arrayRepeatable field set

All fields support these standard attributes:

AttributeTypeRequiredDescription
typestringYesThe field type
namestringYesUnique field identifier
labelstringNoDisplay label in admin
defaultanyNoDefault value

For upload and relationship types:

AttributeTypeRequiredDescription
relationTostringYesCollection to relate to (e.g., "media", "pages")
hasManybooleanNoAllow multiple selections
{
"type": "relationship",
"name": "featuredPosts",
"label": "Featured Posts",
"relationTo": "posts",
"hasMany": true
}

For select and radio types:

AttributeTypeRequiredDescription
optionsarrayYesArray of option objects
{
"type": "select",
"name": "alignment",
"label": "Text Alignment",
"options": [
{ "label": "Left", "value": "left" },
{ "label": "Center", "value": "center" },
{ "label": "Right", "value": "right" }
],
"default": "left"
}

Arrays allow editors to add multiple entries of a repeated structure:

{
"name": "navigation_items",
"label": "Navigation Items",
"type": "array",
"fields": [
{
"type": "text",
"name": "label",
"label": "Label"
},
{
"type": "text",
"name": "url",
"label": "URL"
},
{
"type": "checkbox",
"name": "openInNewTab",
"label": "Open in New Tab",
"default": false
}
]
}

Accessing array data in templates:

<nav>
{% for item in settings.navigation_items %}
<a href="{{ item.url }}"
{% if item.openInNewTab %}target="_blank" rel="noopener"{% endif %}>
{{ item.label }}
</a>
{% endfor %}
</nav>

Groups can contain other groups for hierarchical organization:

{
"name": "colors",
"label": "Color Settings",
"type": "group",
"fields": [
{
"name": "primary",
"type": "group",
"label": "Primary Colors",
"fields": [
{ "type": "color", "name": "background", "label": "Background" },
{ "type": "color", "name": "text", "label": "Text" }
]
},
{
"name": "secondary",
"type": "group",
"label": "Secondary Colors",
"fields": [
{ "type": "color", "name": "background", "label": "Background" },
{ "type": "color", "name": "text", "label": "Text" }
]
}
]
}

Accessing nested settings:

<style>
:root {
--primary-bg: {{ settings.colors.primary.background }};
--primary-text: {{ settings.colors.primary.text }};
--secondary-bg: {{ settings.colors.secondary.background }};
--secondary-text: {{ settings.colors.secondary.text }};
}
</style>
  1. Use descriptive names - Field names should be clear and consistent (e.g., donateLink not link1)

  2. Provide defaults - Always set sensible default values so themes work out of the box

  3. Group logically - Organize related settings together (header, footer, social, etc.)

  4. Use appropriate types - Choose field types that match the expected input (use color for colors, not text)

  5. Keep it minimal - Only expose settings that editors actually need to customize

  6. Document your settings - Include theme_documentation_url to link to your theme docs