Template Authoring Guide (Jinja Essentials)¶
Your template file is a standard document with special VIBE commands mixed in. These commands use a language called Jinja. You only need to know a few core commands and helpers to do most of what you'll need.
If you are authoring in Microsoft Word rather than Markdown, pair this guide with the DOCX Authoring Guide.
Printing a Variable: {{ ... }}¶
This is the most common command. It tells VIBE to "print the value of this variable here."
Conditional Logic: {% if ... %}¶
This allows you to show or hide entire blocks of text based on the user's answers. Every {% if %} must be closed with an {% endif %}.
Using a bool (Yes/No) variable:
Comparing a variable to a value:
{% if contract_type == 'premium' %}
As a premium client, you are entitled to 24/7 support.
{% else %}
Standard support hours are 9 AM to 5 PM.
{% endif %}
Looping Through a List: {% for ... %}¶
If you have a list question type, you can loop through each item the user entered and print its details.
**Project Stakeholders:**
{% for stakeholder in project_stakeholders %}
- Name: {{ stakeholder.name }}, Email: {{ stakeholder.email }}
{% endfor %}
Local Variables: {% set ... %}¶
You can create local variables with {% set %}. This is useful for creating shorter aliases for long variable names or complex expressions, making the template more readable.
{% set auth = selected_regulatory_authorities %}
{% if auth['SEC'] %}the Securities and Exchange Commission{% endif %}
{% if auth['FCA'] %}the Financial Conduct Authority{% endif %}
{% set period = liability_cap_rolling_period %}
{% if period == "calendar_year" %}per calendar year{% elif period == "quarter" %}per quarter{% endif %}
Local variables set with {% set %} only exist in the current template — they don't affect other templates or components.
Using Filters: |¶
Filters modify a variable's value before it's printed. You use the pipe | character:
This shows a styled placeholder [Client Name] (bracketed and highlighted) if client_name hasn't been answered yet, and the actual value once it has. The filter has locale aliases so it reads naturally in the template's language — for example, Swedish templates use | eller:
For the complete list of built-in filters (formatting, linguistic, etc.) and functions
(defined(), insert(), show_message(), and more), see
Template Functions, Filters & Metadata.