Opened 8 years ago

Closed 8 years ago

#2743 closed enhancement (fixed)

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

Reported by: martin.glueck@… Owned by: mtredinnick
Component: Template system Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


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 %}">
{% if obj.need_second_row %}
<tr class="{{ background }}">


{% endif %}

{% endfor }%

Attachments (1)

cycle.patch (1.9 KB) - added by martin.glueck@… 8 years ago.
The patch for the tag enhancement and a new testcase for the new features

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by martin.glueck@…

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

comment:1 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.