I have a template variable, c.is_friend, that I would like to use to determine whether or not a class is applied. For example:
if c.is_friend is True
<a href="#" class="friend">link</a>
if c.is_friend is False
<a href="#">link</a>
Is there some way to do this inline, like:
<a href="#" ${if c.is_friend is True}class="friend"{/if}>link</a>
Or something like that?
Python's normal inline if works:
<a href="#" ${'class="friend"' if c.is_friend else ''}>link</a>
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