Themes built on the Twig templating engine are now deprecated and require migration to Vitrin to ensure continued support and compatibility with Zid.
The theme editor reads a JSON schema that defines display settings for merchants in the theme editor.
section.jinja is required to have a corresponding section.schema.json file in the same directory.| Field | Type | Description | Required |
|---|---|---|---|
| name | object {ar,en} | Section title shown to the merchant (Arabic/English). | |
| template | string | Path to the section’s Jinja template (e.g., "sections/image_slider.jinja"). | |
| settings | array | List of inputs the merchant can change (see Input Settings). | |
| icon | text | Optional reference to an icon at the section parent level only. Use Remixicon class names without the ri- prefix (e.g., box-3-line, image-add-line). See Remixicon for available icons. Note: icon should only be defined at the parent section level, not within individual settings objects. |
/sections/image_slider.schema.json file would look like:{
"name": {
"ar": "شرائح الصور",
"en": "Image Slider"
},
"settings": [
{
"default": true,
"id": "hide_dots",
"label": {
"ar": "إخفاء النقاط",
"en": "Hide dots"
},
"type": "checkbox"
}
],
"template": "sections/image_slider.jinja"
}layout.schema.jsonheader.schema.jsonfooter.schema.json| Field | Type | Description | Required |
|---|---|---|---|
| name | object {ar,en} | Section title shown to the merchant (Arabic/English). | |
| groups | array | List of objects that represent each group of settings. The structure of a group is almost identical to the schema of an individual section, but each group requires an id. | |
| icon | text | Optional reference to an icon at the group parent level only. Use Remixicon class names without the ri- prefix (e.g., box-3-line, image-add-line). See Remixicon for available icons. Note: icon should only be defined at the parent group level, not within individual settings objects. |
{
"groups": [
{
"icon": "box-3-line",
"id": "header",
"name": {
"ar": "رأس الصفحة",
"en": "Header"
},
"settings": [
{
"id": "logo",
"info": {
"ar": "ارفع صورة بحجم 750 * 750 ",
"en": "This is an info text sample here"
},
"label": {
"ar": "الشعار",
"en": "Logo"
},
"type": "image"
}
]
}
],
"icon": "layout-grid-line",
"name": {
"ar": "اعلى الصفحة",
"en": "Header"
}
}{
"icon": "fa fa-square",
"name": {
"ar": "اعلى الصفحة",
"en": "Header"
},
"groups": [
{
"id": "header",
...
"settings": [
{
"id": "logo",
...
}
}
]
}
]
}settings.header_logo in your jinja file templates.{% for image in safeget(settings, "images", []) %}safeget to handle cases where a variable could be null. You can add a default value as the third paremeter of the safeget global function.icon field in schema files accepts Remixicon class names without the ri- prefix. Icons should only be defined at the parent level of section.icon at the root level of the section schema (alongside name, template, settings)box-3-line, image-add-line, layout-grid-line)icon field — do NOT include the ri- prefix{
"icon": "image-add-line",
"name": {
"ar": "شرائح الصور",
"en": "Image Slider"
},
"settings": [
{
"id": "hide_dots",
"label": { "ar": "إخفاء النقاط", "en": "Hide dots" },
"type": "checkbox"
}
],
"template": "sections/image_slider.jinja"
}ri- when rendering the icon in the theme editor.slider.jinja):| View | File Name |
|---|---|
| Desktop | slider |
| Mobile | slider_mobile |
png, jpg, jpegsections/
├── slider.jinja
├── slider.png # Desktop preview
├── slider_mobile.png # Mobile preview
├── testimonials.jinja
├── testimonials.jpg # Desktop preview
├── testimonials_mobile.jpg # Mobile preview
└── ...featured-products.jinja:sections/
├── featured-products.jinja
├── featured-products.png # Shown when desktop frame is selected
└── featured-products_mobile.png # Shown when mobile frame is selected