ifΒΆ

Selects an argument depending on a condition.

For example:

{{ value|if:"yes":"no" }}

This is a shortcut for using the if tag. The same can be expressed as follows:

{% if value %}yes{% else %}no{% endif %}

Note that falsy values (0, false, undefined or empty string) evaluate to false.

See also

if, if_undefined

Previous topic

group_title_firstchar

Next topic

if_undefined

Versions

Actions