summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2009-04-16 12:46:15 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2009-04-16 12:46:15 +0000
commitf3c3aa232c552937672af3cb12e5af4826a97a05 (patch)
treefc88f72e449b736e8950bd2a8df145cdb0e67d75 /docs
parent163bf995a5aaf2ca0e36ce769d26ce9ebccd4376 (diff)
Fixed #10704 -- Resurrected documentation for {% else %} clause on {% ifchanged %}, lost during docs refactor. Thanks to Tarken for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10563 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/templates/builtins.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index 71ac2b19d1..f4e49a9f52 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -359,6 +359,19 @@ The 'ifchanged' block tag is used within a loop. It has two possible uses.
{% endifchanged %}
{% endfor %}
+The ``ifchanged`` tag can also take 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 %}
+
.. templatetag:: ifequal
ifequal