I have a macro for form fields, including select:
{% macro select(name, options) %}
<select name="{{ name }}">
{% for key, value in options %}
<option value="{{ key }}">{{ value }}</option>
{% endfor %}
</select>
{% endmacro %}
Which I call with:
{{ macro.select('name', {'key': 'value'}) }}
This works well when I define the key and value, however, I want to populate it from my categories.
{% set categoriesQuery = craft.categories().group('categories').all() %}
How can I make {'key': 'value'}
loop over results from categoriesQuery
? Hope that makes sense!