Opened 18 years ago

Closed 18 years ago

#2743 closed enhancement (fixed)

[patch] Extension of the {% cycle %} tag

Reported by: martin.glueck@… Owned by: Malcolm Tredinnick
Component: Template system Version: dev
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no
Pull Requests:How to create a pull request

Description

The attached patch extendes named cycle tags so that the current value of the cycle will be added to the context so that it is accessable in templates as a normal variable.

For example,

{% for obj in object_list %}

<tr class="{% cylce gb1,gb2 as background %}">
[....]
</tr>
{% if obj.need_second_row %}
<tr class="{{ background }}">

[....]

</tr>
{% endif %}

{% endfor }%

Change History (2)

by martin.glueck@…, 18 years ago

Attachment: cycle.patch added

The patch for the tag enhancement and a new testcase for the new features

comment:1 by Malcolm Tredinnick, 18 years ago

Resolution: fixed
Status: newclosed

(In [3773]) Fixed #2743 -- Made the value of a cycle tag accessible through the context.
Patch from Martin Glueck.

Note: See TracTickets for help on using tickets.
Back to Top