Doesn't work for printing single value from multivalue field in twig

Created on 24 November 2023, about 1 year ago

For a multivalue field, if you want to print a single value of that field in twig, you'd expect to use:

{{ content.field_my_text.0 }}

But the text format you will get for that is the filter format configured for the field widget, not the override filter format from the field formatter.

Is this expected behaviour, or should the field content variable in twig be overridden by the formatter for each value of a multivalue field?

It does work if you print all field values, ie {{ content.field_my_text }}

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇳🇿New Zealand john pitcairn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024