Logic

Conditional blocks

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

Example 1

User any boolean variables.

{% 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.

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

Rejoignez des milliers de super entreprises

Commencez gratuitement. Pas de carte de crédit nécessaire. Annulez à tout moment.