1

How do I add a custom region in the bootstrap theme using Drupal 8?

I have installed a Bootstrap theme and now I want to add a custom region before the Header region. What should I add in the theme .info file? How do I render it in the page template?

1 Answer 1

2
  1. In your sub-theme's .info.yml file add the new region alongside the existing ones, e.g.

    regions:
      header: Header
      content: Content
      sidebar_first: 'Sidebar first'
      footer: Footer
      custom_region: 'Custom region'
    
  2. Then in your page.html.twig file render it like so:

    {{ page.custom_region }}
    
  3. Visit the Block layout admin page and assign some blocks to the region so it displays on the page.

1
  • Exactly, sir, it's working finally. Sep 27, 2017 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.