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 Drupal\entity_reference_revisions\Plugin\Field\FieldType\EntityReferenceRevisionsItem cannot be printed. in Drupal\Core\Template\TwigExtension->escapeFilter() (line 465 of DRUPAL_ROOT\exp\core\lib\Drupal\Core\Template\TwigExtension.php).
Exception: Object of type Drupal\node\Entity\Node cannot be printed. in Drupal\Core\Template\TwigExtension->escapeFilter() (line 465 of DRUPAL_ROOT\exp\core\lib\Drupal\Core\Template\TwigExtension.php).