Change record status: 
Introduced in branch: 
Introduced in version: 

In Drupal 7 it was possible to specify separate block templates per region, such as block--header.tpl.php and block--footer.php to output different HTML for blocks placed in the header and footer regions. It was also possible to adjust variables based on region in hook_preprocess_block(). Both of these features have been removed.

It is suggested you use standard CSS cascading selectors to style blocks differently on different parts of the page.

Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other updates done


Benia’s picture

If I use CSS to hide #sidebar, in whatever theme, a wide blank block is created instead; The sidebar region keeps staying, but just as an empty and blank "box".

allan00958’s picture

I don't know if you found the answer already but maybe try this in your page.html.twig:

<div class="someClass">
    <div class="row">
        {% if page.sidebar %}
            <div class="col-12">
               {{ page.sidebar}}
        {% endif %}

Maybe add an if statement and hide the sidebar using a preprocess function.