Say I have this:
{% if files %} Update {% else %} Continue {% endif %}
In PHP, say, I can write a shorthand conditional, like:
<?php echo $foo ? 'yes' : 'no'; ?>
Is there then a way I can translate this to work in a jinja2 template:
'yes' if foo else 'no'
Yes, it's possible to use inline if-expressions:
{{ 'Update' if files else 'Continue' }}
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