Posted By

apmartins on 03/27/13


Tagged

node drupal Regions


Versions (?)

Render drupal regions in node


 / Published in: PHP
 

Enables the usage off regions in node.tpl

  1. function themename_preprocess_node(&$variables) {
  2. // Get a list of all the regions for this theme
  3. foreach (system_region_list($GLOBALS['theme']) as $region_key => $region_name) {
  4. // Get the content for each region and add it to the $region variable
  5. if ($blocks = block_get_blocks_by_region($region_key)) {
  6. $variables['region'][$region_key] = $blocks;
  7. }
  8. else {
  9. $variables['region'][$region_key] = array();
  10. }
  11. }
  12.  
  13. }

Report this snippet  

You need to login to post a comment.