Is there a way to implement conditional OR inside templates? {% if %} would see if true or not...but what i'm looking for is to implement smthing when {% if %} OR {% if %}..thanks
in Django 1.2, you can use OR inside an IF tag...see the built-in template tags
{% if var1 == 'val1' or var2 == 'val2' %}
You can use the firstof template tag. It works similar to an "or":
var1 or var2
will use var1, if it is True or var2, if it is False. Exacly like this statement in the template:
{% firstof var1 var2 %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With