Skip to content

Instantly share code, notes, and snippets.

@jacine
Created November 19, 2011 01:02
Show Gist options
  • Save jacine/1378246 to your computer and use it in GitHub Desktop.
Save jacine/1378246 to your computer and use it in GitHub Desktop.

Revisions

  1. jacine created this gist Nov 19, 2011.
    17 changes: 17 additions & 0 deletions template.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    <?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'));
    }
    }