I have a content type called (My Page) with 3 paragraph types, for a slider to display images, for text to display text, and for sidebar content. (The sidebar is a <div>
, not a Drupal region/block).
Using the page.html.twig template, I am able to output the content to {{ page.content }}
. However, it dumps all the content of all 3 paragraph types in one place.
I'd like to be able to separate the content as in this screenshot.
Paragraph type 1 should be rendered in <header>
, paragraph type 2 in <main>
, and paragraph type 3 in <div id="sidebar">
.
The page.html.twig template is the following. (I simplified the section responsible for outputting the paragraph type content.)
{% block content %}
*****I'd like to paragraph type 1 to output here****
{{ page.content }} *****I'd like to paragraph type 2 to output here****
*****I'd like to paragraph type 3 to output here****
{% endblock %}
```
I use the Barrio subtheme.
If I can just figure out how to separate the content across the 3 <div>
, that would be great.
Is there a conditional logic I could use?
if paragraph type 1 machine name = X
{{ page.content}}
if paragraph type 2 machine name = Y
{{ page.content}}
if paragraph type 3 machine name = Z
{{ page.content}}
This has me stumped as a newbie.