I've created a few new region in my yml

      header: "Header"
      jumbotron: "Jumbotron"
      chiffres: "Chiffres"
      steps: "Etapes"
      presentation: "Presentation des formules"
      map: "Carte"
      nav: "Navbar"
      content: "Content"
      footer: "Footer"

Those regions are displayed in my backend and I can place some block inside.

I've also created a region--thename.html.twig for each one of my new regions.

I want to do this in my page--front.html.twig

    {{ page.header }}

<main class="d-flex flex-column">
    {{ page.jumbotron }}
    {{ page.chiffres }}
    {{ page.presentation }}
    {{ page.steps }}
    {{ page.map }}

{% if page.footer %}
  {{ page.footer }}
{% endif %}

But my regions are showing only if I add a block inside it.

This is my first drupal, so i may have miss something...

  • 1
    Not sure you've actually asked a question, what's your issue? – Leigh May 28 '20 at 9:52
  • Sorry if it's not clear. Basically, I want to add the content static of my region into my page--front – Morgan Tartreau May 28 '20 at 9:57
  • Empty regions don't get printed, that's right. I still don't get the question. Can you maybe ask a real question somehow? – leymannx May 28 '20 at 9:59
  • Hmmm... How to display my region--header.html.twig ? I have a <nav> inside it for exemple. Then I need to display the content of my region--chiffres.html.twig (only html inside it) – Morgan Tartreau May 28 '20 at 10:20
  • 3
    The purpose of regions are to dynamically render blocks placed inside them. If you want to render static HTML, write it directly in your page.html.twig instead, or use Twig include ´{% include '@mytheme/static.html.twig' %}`. – Hudri May 28 '20 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.