Created
November 19, 2011 01:02
-
-
Save jacine/1378246 to your computer and use it in GitHub Desktop.
Bye, bye region.tpl.php and block--system--main.tpl.php
This file contains 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 | |
/** | |
* Implements hook_page_alter(). | |
*/ | |
function mytheme_page_alter(&$page) { | |
// Remove all the region wrappers. | |
foreach (element_children($page) as $key => $region) { | |
if (!empty($page[$region]['#theme_wrappers'])) { | |
$page[$region]['#theme_wrappers'] = array_diff($page[$region]['#theme_wrappers'], array('region')); | |
} | |
} | |
// Remove the wrapper from the main content block. | |
if (!empty($page['content']['system_main'])) { | |
$page['content']['system_main']['#theme_wrappers'] = array_diff($page['content']['system_main']['#theme_wrappers'], array('block')); | |
} | |
} |
Great tip. Thanks!
thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awesome, thanks!