Loop through entity in a template I have a Site with a Twig Template. I have an multiple entity references which I want to loop trough and print out the name, description of each entity.

In my template I'm using the following code to loop through entities.

{% for item in node.field_workers %}
 {{ item.entity.field_name.value }}
{% endfor %}


This loops trough all my entities but won't output any value whatsoever.
I tried using kint() to debug the process. When I try kint(item.entity) it shows me the following structure:

protected fields --&gt; field_name


When I try kint(item.entity.fields) it redirects me to 'drupal/install' page when I try to load the page.

What am I doing wrong?
As Kevin says in his comment, Drupal will do most of the work for you if you use view modes on the referenced content type:

/admin/structure/types/manage/{referenced-content-type}/display

In your case, you might want to modify the Teaser view mode so that it hides all fields except for Name and Description. (If you are already using the Teaser for something else, you can create a new view mode.)

Then, when you render the entity reference field, just use the format "Rendered Entity" and configure the view mode that you wish to render (e.g., Teaser).