Skip to content

Add region between header and main content

Summary

Add a region between the Header and the Main Content that has 100% width.

Implementation

check https://www.drupal.org/docs/theming-drupal/adding-regions-to-a-theme

1) Define the new region

Regions in Drupal are defined in info.yml file. Define a region between header and content called "Pre main content"

premaincontent: "Pre Main Content"

2) Create the region in the template

The change should be done in page.html.twig and more specifically before main and after header (https://gitlab.cern.ch/web-team/drupal/public/d8/themes/cern/-/blob/master/templates/layout/page.html.twig#L203). The section should be a div that holds full width (hence col-sm-12)

Edited by Konstantinos Platis