Skip to main content Link Menu Expand (external link) Document Search Copy Copied

The theme config file theme.json

Example theme.jsonfile

{
  "name": "Default Theme",
  "templates": [
    {
      "template": "locator.liquid",
      "name": "Store locator",
      "key": "store-locator",
      "type": "locator",
      "url": "/store-locator",
      "content_type": "text/html",
      "sitemap_visible": true,
      "sitemap_changefreq": "weekly",
      "sitemap_priority": 1,
      "query_parameters": [{
        "key": "bundle",
        "allowed_values": ["family","business"],
        "propagate_to_page_urls": false
      }]
    }
  ],
  "remote_snippets": [
    {
      "name": "promotions",
      "key": "promotions",
      "source": "https://...promotions.csv"
  	}
  ],
  "variables": {
    "favicon_url": "",
    "maps_api_key": "",
    "twitter_page": "",
    "facebook_page": "",
    "maps_provider": "carto",
    "primary_color": "#ff5500",
    "show_whole_map_on_load": "true",
    "locator_list_of_areas_mode": "administrative_area_level2"
  },
  "default_locale": "es",
  "published_locales": [
    "es",
    "en"
  ]
}

Name

Is the name of the theme

Variables

Custom theme variables. Check the chapter about context variables.

Templates

As you can see in the previous example, each template is defined by 6 parameters:

  • template: Is the file name of the template. The system will look for a file with that name inside the templates folder.

  • name: Is just a humanized name to easily identify your template

  • key: Is a unique name to identify the template. This key will be used by you to create links inside templates to other templates. Can’t contain spaces, only letters, numbers and dashes (-).

  • type: Is the type of the template and defines which data context will be used. Available types are:

    • locator
    • store
    • landing
    • city
    • administrative_area_level1
    • administrative_area_level2
    • country
  • url: Is the url pattern to use when pages are created. Depending on the type of the template, the url can include tokens in the pattern when the type of the template create multiple pages (for example the store type)

    List of allowed tokens per type of template:

    Type Tokens
    Locator No url tokens allowed
    Store & Landing :id :external_id :custom_slug :slug, :locality :country_code :name, :country, :city, :administrative_area_level1 (:region, :autonomous_community, :state), and :administrative_area_level2 (:district, :province, :county)
    City :country, :city, :administrative_area_level1 (:region, :autonomous_community, :state), and :administrative_area_level2 (:district, :province, :county)
    AdministrativeAreaLevel1 :country and :administrative_area_level1 (:region, :autonomous_community, :state)
    AdministrativeAreaLevel2 :country, :administrative_area_level1 (:region, :autonomous_community, :state), and :administrative_area_level2 (:district, :province, :county)
    Country :country
  • content_type: Is the desired HTTP Content-Type response header for the resulting view of the template. Available types are these:

    • text/html
    • application/ld+json
    • application/json
    • application/javascript
    • text/css
    • text/csv

Remote snippets

Array of remote snippets. Remote snippets are just snippet that the content is provided from an url. The frequency of update a remote snippet is approx 1 per day.

As you can see in the previous example, each remote snippet is defined by 3 parameters:

  • name: Is just a humanized name to easily identify your remote snippet.
  • key: Is a unique name to identify the remote snippet. This key will be used by you to create links inside templates to other templates. Can’t contain spaces, only letters, numbers and dashes (-).
  • source: URL with the content to be added (html, csv, json)

Default locale

You must designate a default locale file. Only one default file is permitted

Published locales

Array list of the published locales in the theme. This allows to create drafts of locales without creating content.