How to access a custom field in a field twig loop?

by Sébastien Gicquel   Last Updated December 19, 2017 11:07 AM

I have a content type article which have a field repeatable "related content"

I use a field twig where I have this loop

{% for item in items %}
    {{ item.content }}
{% endfor %}

It works very well : it displays title of the article and a link to the content.

I would like also to display some subfields associated with this content but I'm not successful.

I’ve tried things like :

{{ item.content.field_date_mise_a_jour_article.value }}

but obviously it doesn’t work.

How can I do that ?

In node--article.html.twig, i can access the related content subfield like that :

{{ node.field_suggestion_articles.entity.field_date_mise_a_jour_article.value }}

How can I do the same in

field--field-suggestion-articles.html.twig
Tags : 8 theming fields


Related Questions


How to render field attribute in foreach

Updated April 28, 2015 21:03 PM

Split content data and display field data in node theming

Updated September 26, 2016 09:03 AM


Images instead of radio buttons in node/add form

Updated May 16, 2017 10:07 AM