3. Loops¶
<ul>
{% for item in seq %}
<li>{{ item }}</li>
{% endfor %}
</ul>
{% for item in items %}
{{ item }}
{% else %}
No items!
{% endfor %}
Variable |
Description |
|
The current iteration of the loop. (1 indexed) |
|
The current iteration of the loop. (0 indexed) |
|
The number of iterations from the end of the loop (1 indexed) |
|
The number of iterations from the end of the loop (0 indexed) |
|
True if first iteration. |
|
True if last iteration. |
|
The number of items in the sequence. |
|
A helper function to cycle between a list of sequences. See the explanation below. |
|
Indicates how deep in a recursive loop the rendering currently is. Starts at level 1 |
|
Indicates how deep in a recursive loop the rendering currently is. Starts at level 0 |
|
The item from the previous iteration of the loop. Undefined during the first iteration |
|
The item from the following iteration of the loop. Undefined during the last iteration |
|
True if previously called with a different value (or not called at all) |