I have a content type, basic, where i have added a Paragraph field field_pr
that has two fields: field_text
, field_color
. I have a twig template node--basic--full.html.twig
where I want to print the value of the paragraph field node.field_pr
.
node.field_pr
can have between one and ten paragraph values.
When I print the array for content.field_pr
, I get a huge array. However, I only want the values from the field_pr.field_text
and field_pr.field_color. How would I be able to do this from the node twig template?
I have tried the following but cannot seem to access the values. What am I missing?
{% for field in content.field_pr %}
{{ field[loop.index0].entity.field_text.value }}
{{ field[loop.index0].entity.field_color.value }}
{% endfor %}
{% for field in content.field_pr %}
{{ field[loop.index0]['#paragraph'].field_text.value }}
{{ field[loop.index0]['#paragraph'].field_color.value }}
{% endfor %}
Here is an image of the array that is printed for the node.field_pr
field.