Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save paboden/dd2ad3a9c97e58dec6e127b1f93964f0 to your computer and use it in GitHub Desktop.

Select an option

Save paboden/dd2ad3a9c97e58dec6e127b1f93964f0 to your computer and use it in GitHub Desktop.
Drupal 8/9: Get a field in a paragraph entity in a paragraph entity inside of a node entity
{% for item in node.field_content %}
<h3>{{item.entity.field_heading.value }}</h3>
<ul>
{% for s in item.entity.field_section_content %}
{% set sub = s.entity.field_sub_heading.value %}
{% set icon = s.entity.field_media_type.value %}
<li class="{{ icon }}"> {{ sub }}</li>
{% endfor %}
</ul>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment