summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-01-16 07:07:53 -0500
committerTim Graham <timograham@gmail.com>2014-01-16 07:07:53 -0500
commit9e5033b302676856901a7808910fcab5c3fe1d27 (patch)
tree3dd1225efc2c9e87759b21ef995d2855ef45243d /docs
parent34490792f167f7703cf4396b4bb26163a8af6382 (diff)
Fixed #21747 -- Added {% elif %} to template topics guide.
Thanks gcc for the suggestion.
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/templates.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/topics/templates.txt b/docs/topics/templates.txt
index 53ee292e37..92114aebe5 100644
--- a/docs/topics/templates.txt
+++ b/docs/topics/templates.txt
@@ -211,18 +211,23 @@ tags:
{% endfor %}
</ul>
-:ttag:`if` and ``else``
+:ttag:`if`, ``elif``, and ``else``
Evaluates a variable, and if that variable is "true" the contents of the
block are displayed::
{% if athlete_list %}
Number of athletes: {{ athlete_list|length }}
+ {% elif athlete_in_locker_room_list %}
+ Athletes should be out of the locker room soon!
{% else %}
No athletes.
{% endif %}
In the above, if ``athlete_list`` is not empty, the number of athletes
- will be displayed by the ``{{ athlete_list|length }}`` variable.
+ will be displayed by the ``{{ athlete_list|length }}`` variable. Otherwise,
+ if ``athlete_in_locker_room_list`` is not empty, the message "Athletes
+ should be out..." will be displayed. If both lists are empty,
+ "No athletes." will be displayed.
You can also use filters and various operators in the :ttag:`if` tag::