I have double nested paragraphs which I am trying to loop through on my twig file. The paragraph structure is as follows:
SLIDER WRAPPER PARAGRAPH
- reference slide paragraph (entity reference revisions)
SLIDE PARAGRAPH
- title (text field)
- reference component library (entity reference revisions)
In my wrapper twig file, I have been able to loop through the reference slide field on the wrapper paragraph and have rendered out the title of the slide, using the below code:
<div class="row">
<div class="col-sm-12">
{% for key, item in content.content.field_slide_reference if key|first != '#'%}
{{ item['#paragraph'].field_title[0].value|raw }}
{# WANT TO RENDER REFERENCE COMPONENT LIBRARY HERE, BELOW NOT WORKING #}
{{ item['#paragraph'].field_reference_component_library[0].value }}
{% endfor %}
</div>
</div>
Currently I'm receiving the following error:
USER ERROR: "TARGET_ID" IS AN INVALID RENDER ARRAY KEY IN DRUPAL\CORE\RENDER\ELEMENT::CHILDREN() (LINE 98 OF CORE/LIB/DRUPAL/CORE/RENDER/ELEMENT.PHP
Any idea on how I achieve this?