forloop
Loop state inside for.
Available in: Inside for.
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
forloop.index |
number | 1-based index. |
forloop.index0 |
number | 0-based index. |
forloop.rindex |
number | Index from the end (1-based). |
forloop.rindex0 |
number | Index from the end (0-based). |
forloop.first |
boolean | First iteration. |
forloop.last |
boolean | Last iteration. |
forloop.length |
number | Number of iterations. |
Example
Section titled “Example”{% for i in (1..3) %}{{ forloop.index }}{% if forloop.last %}!{% endif %}{% endfor %}123!Compatibility
Section titled “Compatibility”Since theme platform 1.0.
Was this page helpful?

