Sylloo ERP Help Center Sign in

How templating works

How a website theme is built from a layout, page templates, sections, snippets, settings and translations, with copy-ready examples.

Updated 1 Nov 2026 10 min read

How templating works

A Sylloo website theme is a set of small files. A layout is the frame of every page, a page template lists which sections a page shows, and each section is a piece of HTML with its own settings. The business then changes texts, pictures, colours and the order of sections in the website builder, without code.

Templates use Twig, a simple template language: {{ ... }} prints a value and {% ... %} runs a rule such as if or for.

You edit and preview theme files in Theme Studio. Nothing you change reaches visitors until you publish.

When you use this

  • You want to understand which file to open before you change a page of your website.
  • You build a new section (for example a promotion banner) that the business can fill in the builder.
  • You add a page template for a new kind of page, such as a "Services" page.
  • You want the fixed words of your theme to show in Bangla or Finnish.

Theme structure

Every theme has these folders. All paths are relative to your theme.

File or folder What it is for
config/theme.json The theme's name, version, default language and the list of pages it has.
config/settings_schema.json The theme settings (logo, colours, fonts, page width, contact, social links), in groups. The business fills them in the website builder.
layouts/base.html The frame of every page: <head>, header group, page content, footer group.
groups/header.json, groups/footer.json The sections shown at the top and bottom of every page.
templates/<page>.json One file per page (home, products, product, cart, page, blog …): which sections the page shows and in which order.
sections/<name>.html + sections/<name>.json One section: its HTML and its settings, blocks and presets.
snippets/<name>.html Small reusable pieces (product card, pagination, slider, form, icons), printed with snippet().
locale/en.json, locale/bn.json, locale/fi.json The theme's fixed words per language, read with t('key', 'Default').
assets/css/theme.css, assets/js/theme.js, assets/img/ The theme's stylesheet, script and pictures.

How it works

When a visitor opens a page, Sylloo builds it in four steps:

  1. It reads the page template, for example templates/home.json, and takes its sections in the order of its order list. Sections marked "disabled": true are left out.
  2. It prints every section file (sections/hero.html …) with that section's saved values in settings, and its blocks in section.blocks.
  3. It puts all printed sections together into {{ content }}.
  4. It prints the layout named in the template ("layout": "base" means layouts/base.html). The layout prints {{ content }} and the header and footer with {{ group('header') }} and {{ group('footer') }}.

The business sees each section and block in the website builder and changes its settings there. You write the HTML once; the business fills it.

Example: Build a small announcement section

This section shows one line of text and an optional link. The business can change the text, the link and the colour scheme.

The HTML, sections/notice.html:

{% if settings.text %}
<div class="announcement color-{{ settings.scheme }}" {{ section.attributes }}>
    {% if link(settings.link) %}
        <a href="{{ link(settings.link) }}" {{ editable('text') }}>{{ settings.text }}</a>
    {% else %}
        <span {{ editable('text') }}>{{ settings.text }}</span>
    {% endif %}
</div>
{% endif %}

Its settings, sections/notice.json:

{
    "name": "notice",
    "title": "Notice bar",
    "category": "header",
    "enabled_on": { "pages": ["*"] },
    "settings": [
        { "id": "text", "type": "text", "label": "Text", "translatable": true, "default": "Free delivery on orders over 1,000" },
        { "id": "link", "type": "url", "label": "Link", "default": "" },
        { "id": "scheme", "type": "color_scheme", "label": "Colour scheme", "default": "scheme_3" }
    ],
    "presets": [ { "name": "Notice bar" } ]
}

Result: Notice bar appears in Add section in the website builder. When the business adds it, the page shows a coloured bar with "Free delivery on orders over 1,000". If the business fills Link, the text becomes a link. If Text is empty, the section prints nothing.

Every part of a theme

config/theme.json

The theme's identity card. pages lists the pages the theme has a template for.

{
    "name": "My Shop",
    "slug": "my-shop",
    "version": "1.0.0",
    "format": 2,
    "default_locale": "en",
    "supports": ["business", "store"],
    "description": "A clean shop with a blog.",
    "thumbnail": "img/thumbnail.svg",
    "pages": ["home", "products", "product", "cart", "pages", "page", "blogs", "blog", "about", "contact", "404"]
}

Result: Theme Studio and the theme list show the name "My Shop", version 1.0.0 and the thumbnail picture.

layouts/base.html

The frame of every page. It must print {{ header }} inside <head> (Sylloo's own styles and scripts: cart, sign-in, forms) and {{ content }} where the page's sections go.

<!DOCTYPE html>
<html lang="{{ locale() }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{ meta.title ?? shop('name') }}</title>
    {% if meta.description %}<meta name="description" content="{{ meta.description }}">{% endif %}
    {% if settings('favicon') %}<link rel="icon" href="{{ media(settings('favicon')) }}">{% endif %}
    {{ header }}
    <link rel="stylesheet" href="{{ 'css/theme.css'|asset_url }}">
    {{ theme_css() }}
</head>
<body class="color-{{ settings('page_scheme') ?: 'scheme_1' }}">
    {{ snippet('icons') }}
    {{ group('header') }}
    <main id="main">{{ content }}</main>
    {{ group('footer') }}
    <script src="{{ 'js/theme.js'|asset_url }}" defer></script>
</body>
</html>

Result: Every page gets the page title, the browser tab icon, your stylesheet, the colours and fonts from the theme settings, the header sections, the page's sections and the footer sections.

templates/<page>.json

A page template lists the sections of one page. Each key in sections is a name you choose; type is the section file name; order sets the order. Blocks work the same way inside a section: blocks and block_order.

{
    "name": "home",
    "title": "Home",
    "layout": "base",
    "sections": {
        "hero_1": {
            "type": "hero",
            "settings": { "heading": "Professional service you can rely on" }
        },
        "services_1": {
            "type": "services",
            "settings": {},
            "blocks": {
                "service_1": { "type": "service", "settings": { "title": "Consulting" } },
                "service_2": { "type": "service", "settings": { "title": "Appointments" } }
            },
            "block_order": ["service_1", "service_2"]
        },
        "notice_1": { "type": "notice", "settings": {}, "disabled": true }
    },
    "order": ["hero_1", "services_1", "notice_1"]
}

Result: The home page shows the hero, then the services section with two services. The notice section is kept but hidden ("disabled": true); the business can show it again in the builder.

groups/header.json and groups/footer.json

A group has the same shape as a page template, with "type": "group" and no layout. The layout prints it with group('header').

{
    "name": "header",
    "type": "group",
    "sections": {
        "announcement_1": { "type": "announcement", "settings": { "text": "Book a free first consultation" } },
        "header_1": { "type": "header", "settings": { "show_cart": false } }
    },
    "order": ["announcement_1", "header_1"]
}

Result: Every page starts with the announcement bar and then the header with logo and menu.

sections/<name>.html and sections/<name>.json

A section's HTML reads its own values as settings.<id>. Its JSON describes those settings, its blocks (repeated items such as slides or team members, with max) and at least one preset, so the section appears in Add section.

<section class="section color-{{ settings.scheme }}" {{ section.attributes }}>
    <div class="container">
        <h2 {{ editable('heading') }}>{{ settings.heading }}</h2>
        <div class="grid grid--3">
            {% for block in section.blocks %}
                <div class="feature" {{ block.attributes }}>
                    <h3 {{ editable('title') }}>{{ block.settings.title }}</h3>
                </div>
            {% endfor %}
        </div>
    </div>
</section>
{
    "name": "services",
    "title": "Services",
    "category": "business",
    "enabled_on": { "pages": ["*"] },
    "settings": [
        { "id": "heading", "type": "text", "label": "Heading", "translatable": true, "default": "What we do" },
        { "id": "scheme", "type": "color_scheme", "label": "Colour scheme", "default": "scheme_1" }
    ],
    "blocks": [
        { "type": "service", "title": "Service", "max": 12, "settings": [
            { "id": "title", "type": "text", "label": "Title", "translatable": true, "default": "Consulting" }
        ] }
    ],
    "presets": [ { "name": "Three services", "blocks": [ { "type": "service" }, { "type": "service" }, { "type": "service" } ] } ]
}

Result: The section shows the heading "What we do" and one box per service. In the builder the business can add up to 12 services, change each title and click a text on the page to edit it in place.

snippets/<name>.html

A snippet is a small piece you print in many places. It sees the variables you pass to it.

{# sections/featured_products.html #}
{% for product in product_list(settings.products) %}
    {{ snippet('product_card', { product: product }) }}
{% endfor %}

Result: Each product chosen in the section's Products setting is printed with the same card design from snippets/product_card.html.

config/settings_schema.json

Theme settings apply to the whole website. They are in groups, and each setting has an id, a type, a label and a default. Templates read them with settings('id').

{
    "name": "settings_schema",
    "title": "Theme settings",
    "groups": [
        {
            "id": "brand",
            "title": "Brand",
            "settings": [
                { "id": "logo", "type": "media", "label": "Logo", "default": null, "info": "Leave empty to show the business name." },
                { "id": "tagline", "type": "text", "label": "Tagline", "translatable": true, "default": "Trusted local experts" }
            ]
        }
    ]
}

Result: The website builder shows a Brand group with Logo and Tagline. {{ settings('tagline') }} prints "Trusted local experts" until the business types its own.

Inside a section, settings.heading is that section's own setting. settings('logo') (with brackets) is a theme setting from config/settings_schema.json.

locale/<locale>.json

The fixed words of your theme ("Add to cart", "Sold out") live in one file per language. Keys can be nested. A template reads them with t('key', 'Default').

{
    "product": {
        "add_to_cart": "Add to cart",
        "sold_out": "Sold out"
    }
}
<button type="button">{{ t('product.add_to_cart', 'Add to cart') }}</button>

Result: An English visitor sees "Add to cart". With "add_to_cart": "কার্টে যোগ করুন" in locale/bn.json, a Bangla visitor sees the Bangla words. A key missing in every file shows the default you wrote.

assets/

Your stylesheet, script and pictures. Print their address with the asset_url filter and the path inside assets/.

<link rel="stylesheet" href="{{ 'css/theme.css'|asset_url }}">
<script src="{{ 'js/theme.js'|asset_url }}" defer></script>

Result: The page loads assets/css/theme.css and assets/js/theme.js of your theme.

How to extend

  1. Add a section: create sections/<name>.html and sections/<name>.json (copy the closest section of the theme you started from). Give it a preset so it appears in Add section.
  2. Add a page: create templates/<page>.json and add the page name to pages in config/theme.json. A page in Website › Pages can then use this template.
  3. Add a theme setting: add it to a group in config/settings_schema.json and read it with settings('id').
  4. Add a fixed word: add the key to locale/en.json, locale/bn.json and locale/fi.json and print it with t('key', 'Default').
  5. Add a reusable piece: create snippets/<name>.html and print it with snippet('name', { ... }).

Rules and pitfalls

  • Valid JSON: every .json file must be valid, without trailing commas.
  • Defaults in the schema: give every setting a default in its JSON file, so a new section looks right before the business changes anything.
  • Every setting is used: every setting the HTML reads is in the schema, and every setting in the schema is read. A switch that does nothing confuses the business.
  • Builder marks: put {{ section.attributes }} on a section's outer element, {{ block.attributes }} on each block and {{ editable('id') }} on texts. They print nothing for visitors.
  • Content comes from Sylloo: menus, sliders, forms, pages, blog posts, products and pictures come from their own screens (menu(), slider(), form(), find_page(), get_blog(), product_list(), media()). Do not type them into the template.

Common questions

Can a page show the same section twice? Yes. Add two keys in the page template with the same type, for example hero_1 and hero_2, each with its own settings.

How do I show the words of my theme in other languages? Put them in locale/<locale>.json and print them with t('key', 'Default'). The business types its own texts (headings, button labels) per language in the builder when their setting has "translatable": true.

Where do my pictures come from? Pictures the business chooses come from the File Manager through a media setting; print them with media(settings.image). Pictures that belong to the theme itself go in assets/img/.