Pedro Posada | Define new regions in your theme

Define new regions in your theme

Posted on April 10, 2008 - 10:32am
<< 41 of 50 >>

This snippet contains the default regions in the bluemarine theme. I just copy and paste it in the template.php and start adding new ones to the array. And then I define them inside my page.tpl.php

This is very useful if you want to place blocks in custom places and easily manage them from the blocks page.

<?php

/**
* @desc define new regions in your pages for this theme
*/
function mytheme_regions() {
  return array(
   
'sidebar_right' => t('right sidebar'),
   
'sidebar_left' => t('left sidebar'),
   
'content' => t('content'),
   
'header' => t('header'),
   
'footer_message' => t('footer')
  );
}

?>

Submitted by pedro on June 3, 2009 - 10:55am.

To add custom regions to your themes in drupal 6, add the following lines to your mytheme.info file:

regions[left] = left sidebar
regions[right] = right sidebar
regions[above_content] = above content
regions[content] = content
regions[header] = header
regions[footer] = footer

Submitted by pedro on June 3, 2009 - 2:46pm.

How to add CSS style sheets in drupal 6
http://drupal.org/node/171209

Post new comment

The content of this field is kept private and will not be shown publicly.
Please solve the math question. This way we will know you are not a robot.