for-endfor block
for-endfor block
Section titled βfor-endfor blockβ- For-endfor block renders the content for each item in the sequence. The example below has 5 items in the sequence as denoted by (1..5), so it loops and renders all 5 items.
Example: {% raw %}
{% for index in (1..5) %} {{index}} x 5: {{ index | times: 5}}{% endfor %}{% endraw %}
Output:
1 x 5: 52 x 5: 103 x 5: 154 x 5: 205 x 5: 25