Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit f3c3aa232c552937672af3cb12e5af4826a97a05 1 parent 163bf99
@freakboy3742 freakboy3742 authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 docs/ref/templates/builtins.txt
View
13 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
Please sign in to comment.
Something went wrong with that request. Please try again.