mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 03:10:39 -07:00
Add hash iteration example
@@ -278,6 +278,14 @@ Liquid allows `for` loops over collections:
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
When iterating a hash, `item[0]` contains the key, and `item[1]` contains the value:
|
||||||
|
|
||||||
|
```liquid
|
||||||
|
{% for item in hash %}
|
||||||
|
{{ item[0] }}: {{item[1] }}
|
||||||
|
{% endfor %}
|
||||||
|
```
|
||||||
|
|
||||||
During every `for` loop, the following helper variables are available for extra
|
During every `for` loop, the following helper variables are available for extra
|
||||||
styling needs:
|
styling needs:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user