Skip to content

Instantly share code, notes, and snippets.

@waako
Last active December 11, 2015 21:48
Show Gist options
  • Save waako/4664911 to your computer and use it in GitHub Desktop.
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
<?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