Return to Snippet

Revision: 62970
at March 27, 2013 05:35 by apmartins


Updated Code
function themename_preprocess_node(&$variables) {
  // Get a list of all the regions for this theme
  foreach (system_region_list($GLOBALS['theme']) as $region_key => $region_name) {
    // Get the content for each region and add it to the $region variable
    if ($blocks = block_get_blocks_by_region($region_key)) {
      $variables['region'][$region_key] = $blocks;
    }
    else {
      $variables['region'][$region_key] = array();
    }
  }

}

Revision: 62969
at March 27, 2013 05:33 by apmartins


Initial Code
function tlrla_preprocess_node(&$variables) {
  // Get a list of all the regions for this theme
  foreach (system_region_list($GLOBALS['theme']) as $region_key => $region_name) {
    // Get the content for each region and add it to the $region variable
    if ($blocks = block_get_blocks_by_region($region_key)) {
      $variables['region'][$region_key] = $blocks;
    }
    else {
      $variables['region'][$region_key] = array();
    }
  }

}

Initial URL

                                

Initial Description
Enables the usage off regions in node.tpl

Initial Title
Render drupal regions in node

Initial Tags
drupal

Initial Language
PHP