Is there a way to output a variable in a check_field? I'd like to use one line of code to display a checkbox, and have it be checked or unchecked as determined by a variable:
{% set chk = value == 1 ? 'checked' : '' %}
{{ check_field('name', 'value':1, chk) }}
Right now, this doesn't work, so I end up doing it this way:
{% if value == 1 %}
{{ check_field('name', 'value':1, 'checked':'checked' }}
{% else %}
{{ check_field('name', 'value':1 }}
{% endif %
Not a huge deal, but it's twice as many lines of code.
Thanks.