{% if bCat2 == True %}
<div>True</div>
{% else %}
<div>False</div>
Returns <div>False</div>
even when bCat2
is True
.
Thanks,
Andrew
This part of documentation can help you:
The special constants true, false and none are indeed lowercase. Because that caused confusion in the past, when writing True expands to an undefined variable that is considered false, all three of them can be written in title case too (True, False, and None). However for consistency (all Jinja identifiers are lowercase) you should use the lowercase versions.
Source: http://jinja.pocoo.org/docs/templates/
Try that code:
{% if bCat2 == true %}
<div>True</div>
{% else %}
<div>False</div>
{% endif %}