# cycle

Source: https://zotonic.com/docs/1360/cycle

URI: https://zotonic.com/id/1360

Language: en



Rotate through a list of values.

Rotates through a list of values and outputs them. `{% cycle %}` Is used within a `{% for %}` loop.

::: {.note title="Note"}
You can not apply filters to the cycle values.
:::

Example:

```erlang
{% for a in [1,2,3,4] %}{% cycle "bleu" "blanc" "rouge" %} {% endfor %}
```

Will output “bleu blanc rouge bleu ”.

The list values can be either a string literal, a number literal, a variable or an automatic id (`#name`).

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1360?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1360?language=en>)
