I have a paragraph twig file that I’m adding to my subtheme.
Inside of it I have another paragraph that is being used. And there could be more than 1 of the child paragraph.
I have this code:
{% for key, item in content.field_faq_section_question if key|first != '#' %} {{ item }} {% endfor %}
And it prints the title and the text fields of the paragraph properly. But What I need to do it access each individually here.
I have tried a lot of different ways to access the fields and none work. A dump and a var_dump of item ends with a blank screen.
I could create another twig file for this paragraph, and it works, but I’m hoping to use the key to add an id to a wrapper div.
I’d like to:
{% for key, item in content.field_faq_section_question if key|first != '#' %} {{ item.title }} {{ item.text }} {% endfor %}
What is the best way of doing this?