Drupal 5 :

I need to add a block region at the top of nodes right after title . My theme is basic bluemarine. can someone tell me step by step how to do this ?

Comments

electronicmonkey’s picture

Bumping this one up please. Anyone done something similar ?

wimvb’s picture

Hi there,

Suppose you want to define a new block region named 'floater' with use name 'Extra'.

Hereto you must define all existing regions together with the new region within a file bluemarine.info in your theme/bluemarine directory. If it does not exist, you must create one. Your example now has to look something like follows (excluding the dashed lines!):

----------------------------------------------------------------------------------------------------------------

; $Id: bluemarine.info,v 1.4 2007/06/08 05:50:57 dries Exp $
name = Bluemarine
description = Table-based multi-column theme with a marine and ash color scheme.
version = VERSION
core = 6.x
engine = phptemplate

; Information added by drupal.org packaging script on 2008-02-27
version = "6.1"
project = "drupal"
datestamp = "1204142108"

regions[floater] = Extra
regions[left] = Left sidebar
regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer

-----------------------------------------------------------------------------------------------------------
Observe your block region to be defined in the first line of the regions group. (mind you that all regions must be present in the list)

The next and last thing we have to do is placing a call to this region within the page.tpl.php file on the right spot where you want your region to appear.
In this case, immediately after the existing line which prints the page title, i.e. modify the template as follows:


   after           <?php print $title; ?>
   insert   <?php print $floater ?> 

Observe the $-sign in front of the name 'floater'.

Now, the options for block regions are the standard regions plus the new region 'Extra' (linked to $floater)
This should solve your problem.

Success.

wimvb’s picture

Forgot to mention that you have to clear the caches in order to get things working!

electronicmonkey’s picture

Gee thanks !!
Your solution is for Drupal 6 though. Will it go well with Drupal 5 ?

Jeff Burnz’s picture

Thats for Drupal 6, wasn't the requirement Drupal 5?

// set up the regions
function mythemes_regions() {
  return array(
       'header' => t('header'),
       'left' => t('left sidebar'),
       'right' => t('right sidebar'),
       'extraregion' => t('Extra region'),
       'content' => t('content'),
       'footer' => t('footer')
  );
}
// then you need to make it available in nodes
function _phptemplate_variables($hook, $vars) {
  global $user;  
  
  switch ($hook) {        
    case 'node':            
  
    $vars['extraregion'] = theme('blocks', 'extraregion');    
        
    break;    
  }   
  return $vars;
}
electronicmonkey’s picture

Sorry in what file do I put this ? Not bluemarine.info I'm sure.

nevets’s picture

The Drupal 5 solution goes in the theme template.php file.

electronicmonkey’s picture

Works like a charm. thanks