Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules


6.7. Working with regions and blocks in Drupal

09/09/2019, by mikhail

In order for you to have a new region through which you can display blocks, you need:

  • Add region information to theme.info.yml file
  • Edit page.html.twig, adding the output of a new region to it


Add region data to drupalbook.info.yml file

All regions are united by the regions key:

# Regions
  header: 'Header'
  content: 'Content'
  footer: 'Footer'

The machine name of the region should consist of letters and numbers, you can use the underscore, as well as in PHP variables. The readable name can be indicated in quotation marks or without if there are no spaces, but it is better to always quote the same. The readable name of the region is displayed in the admin panel, and the machine name is used in the page.html.twig template.

Add region output to page.html.twig

All region output is in the page variable. In order to display the desired region, you need to display part of the page variable. Use the machine name of the region for output, for example, we have the header region:

header: 'Header'

Therefore, we use the machine name header:

{{ page.header }}

You can output any region from your theme.info.yml file anywhere in the page.html.twig template.

Standard Drupal Regions

You can always refer to the official documentation: page.html.twig

page.header: to display your site header.
page.primary_menu: to display the main menu of the site.
page.secondary_menu: to display an additional menu.
page.highlighted: to display information over content.
page.help: to display help.
page.content: required region for displaying site content.
page.sidebar_first: first sidebar.
page.sidebar_second: second sidebar.
page.footer: footer of the site.
page.breadcrumb: site breadcrumbs.

You can use the standard regions of Drupal, you can add your own, most importantly, make sure that the name of the region matches its location in page.html.twig.