Page tree

Versions Compared

Key

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

...

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

Limit

The limit parameter is used in a for loop to limit the number of iterations

 {% for var in expression limit:2 %}
   {{ var.expression }}
{% endfor %}

Offset

The offset parameter is used in a for loop to skip a specified number of iterations

 {% for var in expression offset:2 %}
   {{ var.expression }}
{% endfor %}

Range

The for tag can be used to define a range of numbers to loop through

 {% for i in (3..5) %}
   {{ i }}
{% endfor %}

Reversed

The reversed tag reversed the order of the elements in the loop

 {% for var in expression reversed %}
   {{ var.expression }}
{% endfor %}

Include

The include control tag works like this:

...