How to print particular referenced paragraphs in twig?

29/06/2018


I have a content type (say “Ranking”) with following fields:

field_paragraph can reference any number of different paragraphs created with the Paragraphs Module:
paragraphs

So when I print

{{ content.field_paragraph }}

in a template for this node (say node–ranking–full.html.twig), Drupal renders it starting from field.html.twig and iterating

for item in items

over every referenced paragraph and their twigs.

But I need to print a single referenced paragraph (like sub_ranking) somewhere else in my node–ranking–full.html.twig.

Searching through answers to similiar questions and trying to understand anything from kint() I have already produced some crazy variations, none of which worked:

{{ content.field_paragraph.entity.field_sub_ranking.value }}
{{ content.field_paragraph.0.entity.field_sub_ranking.0.value }}
{{ content.field_paragraph.0.entity.sub_ranking.0.value }}
{{ content.field_paragraph[0]['#node'].field_sub_ranking.0.value }}
{{ content.field_paragraph[0]['#node'].field_sub_ranking.value }}
{{ content.field_paragraph.0.entity.field_paragraph.0.entity.sub_ranking.0.value }}
{{ content.field_paragraph.0.entity.field_paragraph.0.entity.field_sub_ranking.0.value }}

How can I render my referenced sub_ranking in my node template?

قالب وردپرس