How to render only markup in region template? I have created a region--footer.html.twig template which only contains the static markup for the footer. Now I would like to render this region at the bottom of each page so I have added the following to the end of page.html.twig:

{{ page.footer }}


This works fine as long as I have connected a block to the footer region under admin/structure/block. If no blocks are placed in the region it is regardes as empty and is not rendered. How can I change so the region--footer.html.twig is used even if there is no blocks placed in the region?

I was thinking of using a preprocess function for the region doing something like this:

function template_preprocess_region(&amp;$variables) {
  if ($variables['region'] == 'footer') {
    $variables['content'] = 1;
  }
}
/**
 * Implements hook_preprocess_page() for page.html.twig.
 */
 function hook_preprocess_page(array &amp;$variables) {
   $variables['page']['footer'] = [     # Specify the region name
     '#theme_wrappers' =&gt; ['region'],
     '#region' =&gt; 'footer',             # Specify the region name
     'phantom_block' =&gt; [
       '#markup' =&gt; ' ',
       '#weight' =&gt; "-100",
     ],
   ];
 }


This way you are adding a block with a space to the region. Forcing Drupal to render that region. But as you will put a static HTML in that region, the content of the phantom block will not be rendered.