{# ids must be unique doc-wide #} {% set id = apos.utils.generateId() %} {% set widget = data.widget %} {% set classPrefix = data.widget.classPrefix %} {% set style = data.widget.style or "checkboxes" %} {% set checkboxLabel = module.getOption('optionLabelPosition', 'legacy') %} {% if style == 'dropdown' and checkboxLabel == 'legacy' %} {% set checkboxLabel = 'last' %} {% endif %}
{% if style == 'checkboxes' %} {{ widget.fieldLabel}} {% if widget.required %} {{ __("(Required)") }} {% else %} {{ __("(Optional)") }} {% endif %} {% for choice in widget.choices %} {% set choiceId = id + apos.utils.slugify(choice.value) %} {% if checkboxLabel == 'first' %} {% elseif checkboxLabel == 'last' %} {% else %} {# for bc this is the default. Harder to style because there is no row container #} {% endif %} {% endfor %} {% else %}
{% for choice in widget.choices %} {% set choiceId = id + apos.utils.slugify(choice.value) %} {% if checkboxLabel == 'first' %} {% else %} {% endif %} {% endfor %}
{% endif %}