Skip to main content
Providing more information.
Source Link
Ryan
  • 111
  • 2

I found the easiest way was to do this:

<?php
  $region = block_get_blocks_by_region('region_name_here');
  print render($region);
?>

See the docs for more information: https://api.drupal.org/api/drupal/modules!block!block.module/function/block_get_blocks_by_region/7

In your module where you tried to print the sidebar region using the method used in a page template, use this snippet above instead. This method can also be used in html.tpl.php where the "usual" method cannot.

I found the easiest way was to do this:

<?php
  $region = block_get_blocks_by_region('region_name_here');
  print render($region);
?>

I found the easiest way was to do this:

<?php
  $region = block_get_blocks_by_region('region_name_here');
  print render($region);
?>

See the docs for more information: https://api.drupal.org/api/drupal/modules!block!block.module/function/block_get_blocks_by_region/7

In your module where you tried to print the sidebar region using the method used in a page template, use this snippet above instead. This method can also be used in html.tpl.php where the "usual" method cannot.

added 38 characters in body
Source Link
Ryan
  • 111
  • 2

I found the easiest way was to do this:

<?php 
 print render($region = block_get_blocks_by_region('region_name_here'));
  print render($region);
?>

I found the easiest way was to do this:

<?php print render(block_get_blocks_by_region('region_name_here')); ?>

I found the easiest way was to do this:

<?php 
  $region = block_get_blocks_by_region('region_name_here');
  print render($region);
?>
Source Link
Ryan
  • 111
  • 2

I found the easiest way was to do this:

<?php print render(block_get_blocks_by_region('region_name_here')); ?>