Zid themes are powered by the Jinja templating engine. Making it easy to embed dynamic data and logic into your theme design while keeping layouts flexible and reusable.
Check out the full Jinja Documentation to discover all available syntax, tags, filters, and features you can apply to build fully customizable and flexible layouts. Understanding the Basics#
Jinja uses two main syntax forms:1.
Output variables — {{ ... }}
Used to display the value of a variable in the template.
2.
Control statements — {{ ... }}
Used for logic, loops, and template structure.
| Tag | Purpose |
|---|
extends | Inherit from a base template |
include | Insert another template inside this one |
for | Loop over sequences |
if/ elif / else | Conditional logic |
set | Assign variables |
Template Inheritance (extends and block)#
Use extends to base your template on another (usually a layout), and block to fill in or override sections.The template inherits the overall HTML structure from main.jinja.
The title and content blocks are overridden to provide page-specific content.
Base Layout Example#
Child templates extend this file and override blocks as needed.
Including Templates (include)#
Use include to insert another template’s contents, similar to a “copy-paste” at render time.
Conditional Logic (if, elif, else)#
Loops (for)#
Variable Assignment (set)#
Filters#
Filters modify values before rendering. Zid supports Jinja’s core filters, plus some platform-specific ones.
Functions#
Functions perform logic or transformations in templates. Jinja provides built-in functions, and Zid adds platform-specific ones (e.g., url_for, asset_url).Null safety#
Jinja templating engine can handle accessing chained null elements safely, however it has limitations
for example trying to iterate on a null element or trying to devide by zero will break the rendering
Jinja provides builtin tests to protect against these mistakes
so you can check if a variable is iterable by testingModified at 2026-02-17 07:02:10