Loop stuff.
Loop over something n times or between a range.
from
: Where to begin the loop. Defaults to1
.times
: Number of times to loop.to
: Where to end the loop.
Use either times
or to
. Do not use both.
value
: The current value of the loop.index
: The number of the iteration.zero_index
: The zero-based index.
{{ loop times="10" }}
{{ value }}
{{ /loop }}
<ul>
{{ entries:listing folder="calendar" limit="10" }}
<li>{{ title }}</li>
{{ /entries:listing }}
</ul>
{{ entries:pagination folder="calendar" limit="10" }}
{{ loop times="{ total_pages }" }}
{{ if index == current_page }}
{{ index }}
{{ else }}
<a href="{{ url }}?page={{ index }}">{{ index }}</a>
{{ endif }}
{{ /loop }}
{{ /entries:pagination }}
<select name="year">
{{ loop from="1995" to="2015" }}
<option value="{{ value }}">{{ value }}</option>
{{ /loop }}
</select>