Round Rock / Austin, Texas
Drupal Web Developer

How to print a Region in node.tpl.php (or another custom tpl.php file) in D7

How to print a Region in node.tpl.php (or another custom tpl.php file) in D7

In theme’s .info file:

regions[content_bottom] = Content Bottom

In your theme's template.php file:

//Make our regions availalbe in the node templates function MYTHEMENAME_preprocess_node(&$vars) { if ($blocks = block_get_blocks_by_region('content_bottom')) { $vars['content_bottom'] = $blocks; $vars['content_bottom']['#theme_wrappers'][] = 'region'; $vars['content_bottom']['#region'] = 'node_region'; } }

In node.tpl.php:

print render($content_bottom);
Drupal 7 Print Region