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. In your sub-theme's .info.yml file add the new region alongside the existing ones, e.g.

      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.

  • Exactly, sir, it's working finally. – Shakil Ahmad Sep 27 '17 at 7:44

Your Answer

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

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