Opened 16 years ago
Closed 16 years ago
#12310 closed (invalid)
Error in "cycle" template tag example
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Documentation | Version: | 1.1 |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
the documentation say that we can use the cycle tag like this :
{% cycle 'row1' 'row2' as rowcolors %}
then
<tr class="{% cycle rowcolors %}">...</tr>
<tr class="{% cycle rowcolors %}">...</tr>
but the correct use is :
<tr class="{{ rowcolors }}">...</tr>
<tr class="{{ rowcolors }}">...</tr>
Note:
See TracTickets
for help on using tickets.
When I try the incantation you provided I always get the first item in the list. The way it is documented works for me. Note that the syntax you provided is for using the cycle tag outside a loop.