Pedro Posada | Define new regions in your theme

Define new regions in your theme

Posted on April 10, 2008 - 10:32am
<< 45 of 54 >>

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.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Copy the characters (respecting upper/lower case) from the image.