Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Russell Keith-Magee authored April 16, 2009

Showing 1 changed file with 13 additions and 0 deletions. Show diff stats Hide diff stats

  1. 13  docs/ref/templates/builtins.txt
13  docs/ref/templates/builtins.txt
@@ -359,6 +359,19 @@ The 'ifchanged' block tag is used within a loop. It has two possible uses.
359 359
             {% endifchanged %}
360 360
         {% endfor %}
361 361
 
  362
+The ``ifchanged`` tag can also take an optional ``{% else %}`` clause that
  363
+will be displayed if the value has not changed::
  364
+
  365
+        {% for match in matches %}
  366
+            <div style="background-color:
  367
+                {% ifchanged match.ballot_id %}
  368
+                    {% cycle red,blue %}
  369
+                {% else %}
  370
+                    grey
  371
+                {% endifchanged %}
  372
+            ">{{ match }}</div>
  373
+        {% endfor %}
  374
+
362 375
 .. templatetag:: ifequal
363 376
 
364 377
 ifequal

0 notes on commit f3c3aa2

Please sign in to comment.
Something went wrong with that request. Please try again.