Returns the first argument in a list of arguments that evaluates to True
.
Variables
a = False b = 0 c = "" d = "hello"
Template
{% firstof a b c d %}
Result
hello
The tag allows for a default string literal:
{% firstof a b c d "goodbye" %}
The default string will be used if all of the preceding arguments evaluate to False
.