Templating Documentation

Logic

Conditional blocks

Please refer to the Liquid documentation for more informations on how to use Liquid conditional blocks.

Example 1

Feel free to use any boolean variables described above whith these conditionnal blocks.

{% if document.invoice? %}
  Invoice number: {{ document.number }}
{% elsif document.estimate? %}
  Estimate number: {{ document.number }}
{% endif %}

Example 2

You can also use these blocks to check the presence of a text variable

{% if document.top_text %}
  {{ document.top_text }}
{% endif %}

For loops

Please refer to the Liquid documentation for more informations on how to use Liquid for loops

Example

Feel free to use any array variables described above whith these for loops.

<ul>
  {% for vat_total in document.vat_totals %}
    <li>{{ vat_total.percentage }} - {{ vat_total.amount }}</li>
  {% endfor %}
</ul>