I have a content type as “worker”. I have a Paragraph “test” and I am referencing “test” paragraph inside my content type “worker”. This allows multiple values to be saved.
How can I get the multiple “test” paragraph’s field_name
inside my node–worker.html.twig file directly?
I am able to get the single value of that field like below:
{{ node.field_test.entity.field_cdsfasdf.value }}
But, unable to fetch the multiple values for this field inside my node–worker.html.twig. I tried using for loop to fetch the multiple values like the code below:
{% for key, item in node.field_para %} {{ key }} <div class="item"> {{ item.entity.field_cdsfasdf.value }} </div> {% endfor %}
But, I am facing the following error:
Exception: Object of type Drupalentity_reference_revisionsPluginFieldFieldTypeEntityReferenceRevisionsItem cannot be printed. in DrupalCoreTemplateTwigExtension->escapeFilter() (line 465 of DRUPAL_ROOTexpcorelibDrupalCoreTemplateTwigExtension.php). Exception: Object of type DrupalnodeEntityNode cannot be printed. in DrupalCoreTemplateTwigExtension->escapeFilter() (line 465 of DRUPAL_ROOTexpcorelibDrupalCoreTemplateTwigExtension.php).