Count multivalue image field values in views-view-fields.html.twig Making a presentation template for the gallery. The photo gallery has an image field with multiple values. I need to output the number of gallery photos (in the field_gallery_photo). How do I do this? I tried adding a field with a photo to the view, and all the values are shown in one line. The result is not accurate:
{{ fields.field_gallery_photo.content | length }}


In version 7 I did the following:

added the nid field

redefined the template for it

specified the following in the template:
$node = node_load($output);
print sizeof($node-&gt;field_gallery_photo['und']);
Your D7 PHP would translate into D8 Twig like this:
{% set node = row._entity %}
{{ node.field_gallery_photo.getvalue | length }}