Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 {% for var in expression %}
   {{ var.expression }}
{% else %}
The collection is empty. {% endfor %}

Break

The break tag is used to break out of a loop

 {% for var in expression %}
   {{ var.expression }}
{% if expression %}
{% break %}
{% endif %}
{% endfor %}

Continue

The continue tag is used to continue to the next iteration of a loop

{% for var in expression %}
   {{ var.expression }}
{% if expression %}
{% continue %}
{% endif %}
{% endfor %}

Cycle

The cycle tag is used to cycle through a list of items within each iteration of a for loop

 {% for var in expression %}
   {{ var.expression }}
{% cycle "odd", "even" %}
{% endfor %}

Include

The include control tag works like this:

...