mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
offset can have a continue value in for loops
This commit is contained in:
@@ -127,6 +127,27 @@ Begins the loop at the specified index.
|
||||
3 4 5 6
|
||||
```
|
||||
|
||||
To start a loop from where the last loop using the same iterator left off, pass the special word `continue`.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
```liquid
|
||||
{% raw %}
|
||||
<!-- if array = [1,2,3,4,5,6] -->
|
||||
{% for item in array limit: 3 %}
|
||||
{{ item }}
|
||||
{% endfor %}
|
||||
{% for item in array limit: 3 offset: continue %}
|
||||
{{ item }}
|
||||
{% endfor %}
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```text
|
||||
1 2 3
|
||||
4 5 6
|
||||
```
|
||||
|
||||
### range
|
||||
|
||||
Defines a range of numbers to loop through. The range can be defined by both literal and variable numbers, and can be pulled from a variable.
|
||||
|
||||
Reference in New Issue
Block a user