I’m using the smartif tag from this snippet (I’m holding on with regards to upgrading to 1.2) in my template for a certain boolean field like so:
{% if payment.extends_membership == "True" %}
{% trans "Yes" %}
{% else %}
{% trans "No" %}
{% endif %}
But whatever the value of extends_membership I get only No as the output. What could be the problem?
Are you sure that
extends_membershipis a string, rather than a boolean?In this particular case, you don’t need smartif anyway – if it is a bool, you can just do:
and if you’re sure it’s a string, this will work: