I have a checkbox field which I want the sum of a certain checkbox:
{% set countPremiere = 1 %}
{% set iterationPremiere = 0 %}
{% set premiereTotal = 0 %}
{% for entry in allEntries %} // the normal loop starts
{% for premiereItem in entry.kompositonsart %} //the checkbox loop starts
{%- if premiereItem.value == 'ua' -%} // only return checked value with 'ua'
{{ countPremiere }}
{% endif %}
{%- endfor -%}
{% set premiereTotal = iterationPremiere + premiereTotal %}
{% endfor %}
{{ premiereTotal }}
That's basically the same as I did here. This doesn't work however. I suspect it is not working because the way checkboxes are looped. Any ideas?