Last active
December 11, 2015 21:48
-
-
Save waako/4664911 to your computer and use it in GitHub Desktop.
Theme page alter function to force region template to render, even if no blocks are assigned to the region
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function THEMENAME_page_alter(&$page) { | |
foreach (system_region_list($GLOBALS['theme'], REGIONS_ALL) as $region => $name) { | |
if (in_array($region, array('header'))) { | |
$page['header'] = array( | |
'#region' => 'header', | |
'#weight' => '-10', | |
'#theme_wrappers' => array('region'), | |
); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment