{% if %} tag with {% elif %} support
Django tempalte tag that supports {% elif %} branches.
- template
- if
- else
- elif
Django tempalte tag that supports {% elif %} branches.
This is a conditional templatetag decorator that makes it *very* easy to write template tags that can be used as conditions. This can help avoid template boilerplate code (e.g. setting a variable in your template to be used in a condition). All you have to do is define a function with expected parameters that returns True or False. Examples are in the code.
2 snippets posted so far.