mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Updated Liquid for Designers (markdown)
@@ -331,6 +331,17 @@ numbers:
|
||||
# results in 1,2,3,4
|
||||
```
|
||||
|
||||
A for loop can take an optional `else` clause to display a block of text when there are no items in the collection:
|
||||
|
||||
```liquid
|
||||
# items => []
|
||||
{% for item in items %}
|
||||
{{ item.title }}
|
||||
{% else %}
|
||||
There are no items!
|
||||
{% endfor %}
|
||||
```
|
||||
|
||||
### Variable Assignment
|
||||
|
||||
You can store data in your own variables, to be used in output or other tags as
|
||||
|
||||
Reference in New Issue
Block a user