diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-07-26 22:09:43 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-07-26 22:09:43 +0000 |
| commit | e29aece743df644cdaa7d8506c6491ac9c1db061 (patch) | |
| tree | 57f7d6046d9c39bca31e04621b4a630b3ac7120d /docs | |
| parent | f763ff4d02b5c99bdb1ebaf63967a24d8e8447ac (diff) | |
Fixed #4534 -- Added an "else" option to the "ifchanged" template tag.
Patch from SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8095 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/templates.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/templates.txt b/docs/templates.txt index d3ec139f06..4bf8214a2a 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -828,6 +828,19 @@ The 'ifchanged' block tag is used within a loop. It has two possible uses. {% endifchanged %} {% endfor %} +The ``ifchanged`` tag also takes an optional ``{% else %}`` clause that will +be displayed if the value has not changed:: + + {% for match in matches %} + <div style="background-color: + {% ifchanged match.ballot_id %} + {% cycle red,blue %} + {% else %} + grey + {% endifchanged %} + ">{{ match }}</div> + {% endfor %} + ifequal ~~~~~~~ |
