Loop over a multi-value field
Fill in your field nameItalic values are placeholders: replace them with your own machine names, or let the builder do it.
Raw entity
Open in builder (Raw entity)Reads the entity directly, before field formatters run.
- Twig
{% for item in node.field_name %} {{ item. value }} {% endfor %}
Render array
Open in builder (Render array)Reads the content render array, after field formatters run.
- Twig
{% for key, item in content.field_name| filter( ( item, key) => key|first != '#') %} {{ item }} {% endfor %}
Helper module
Open in builder (Helper module)Uses a contrib module’s Twig filter or function.
{% for item in content.field_name| children %} {{ item }} {% endfor %}
Gotcha
Raw items expose their properties (value, target_id, entity…). Render-array children are the formatted items; keys starting with # are render properties, not items.
Contrib modules used
See helper modules for what each one provides.