Open eriknyk opened 12 years ago
When I started haanga the "elif" was missing on Django. I can add a filter now but if you can need or if you can wait,yesterday I started a much cleaner version of haanga (it's called Haanga2) that will be more like twig
. It should be ready within a month or so.
That's very good news :), i will wait for it.
Best regards.
Hi cesar,
from: https://docs.djangoproject.com/en/1.4/ref/templates/builtins/#if
if The {% if %} tag evaluates a variable, and if that variable is "true" (i.e. exists, is not empty, and is not a false boolean value) the contents of the block are output:
{% 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.
As you can see, the if tag may take one or several
{% elif %}
clauses, as well as an {% else %} clause that will be displayed if all previous conditions fail. These clauses are optional.New in Django 1.4: Please see the release notes
The if tag now supports {% elif %} clauses.
Actually Haanga is not supporting elif tag,.. twig template engine implements elseif tag, do you have plans to add elif or elseif tag?