Skip to content

Instantly share code, notes, and snippets.

@waako
Created December 7, 2012 13:54
Show Gist options
  • Save waako/4233397 to your computer and use it in GitHub Desktop.
Save waako/4233397 to your computer and use it in GitHub Desktop.
Fore a region to render if it has a template file (region--regionnname.tpl.php) even if it is empty
// Implement a page alter to force certain regions to display even if no blocks exist
function THEMENAME_page_alter(&$page) {
foreach (system_region_list($GLOBALS['theme'], REGIONS_ALL) as $region => $name) {
if (in_array($region, array('REGIONNAME'))) {
$page['REGIONNAME'] = array(
'#region' => 'REGIONNAME',
'#weight' => '-10',
'#theme_wrappers' => array('region'),
);
}
}
}
// Don't forget to remove the if content not empty statement in the region tpl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment