In 4.7 we have some standard regions that are implemented as custom regions. In the blockbar install notes I'm told to edit template.php and add a function that defines custom regions for blockbar use. But when I do so, the standard custom regions disappear.

Blockbar is a great idea, and I want to implement it. But I don't want it to override the standard custom regions.

Now, as I write this it is also tweaky to write "standard custom regions". Given that, e.g., the "header" region is defined by drupal (in 4.7) is it a custom region? That's why I'm writing "standard custom regions". But if it's defined by drupal core, then it's not a custom region, it's a standard region. But it (and the content standard-custom-region) gets dissappeared when I define the custom custom regions that I want blockbar to use.

Maybe the bug is in drupals definition of the standard custom regions?

Maybe the bug is that defining additional regions overrides the existing custom regions?

Comments

dreed47’s picture

Assigned: Unassigned » dreed47

I'm not sure I understand your point. I don't know what you mean by "standard custom regions". I used the terms "standard" and "custom" in the readme but in 4.7 all regions are equal and act the same. The only difference is that Drupal core has a set of default regions already defined. If you are using the phptemplate engine they are defined in the phptemplate.engine file in themes/engines. The default set is 'left sidebar', 'right sidebar', 'content', 'header', and 'footer'. If you want to add your own region to this list, say "top toolbar" then you can create it by adding a template.php file to your theme directory and adding the code:

function bluemarine_regions() {
  return array(
       'top_toolbar' => t('top toolbar'),
  );
}

This is all explained in the handbook and has nothing to do with the Block Bar module. What did you mean when you say

the standard custom regions disappear.
dreed47’s picture

Also...the function I presented above will NOT override the default regions. It will add to the default regions.

epieters’s picture

I see the same behaviour.

I created my own theme (i.e. eric).
In the subdirectory eric, I created template.php with the following function

function eric_regions() {
  return array(
     'blockbar_container_1' => t('container 1'),
     'blockbar_container_2' => t('container 2')
  );
}

Now, when I activate the eric theme, I no longer have left sidebar, right sidebar, header, footer & content, I only have container1 and container2 my dropdown box.

So, I guess the default regions are overwritten.

(I use 4.7 Beta 2)

-- Eric.

dreed47’s picture

Status: Active » Fixed

Yep. Looking at the core Drupal code I see this was changed in core a couple of weeks ago. Not sure why but now your regions function WILL OVERRIDE the defaults instead of add to them. To have both the defaults AND your new ones your function should look like this:

function mytheme_regions() {
  return array(
       'left' => t('left sidebar'),
       'right' => t('right sidebar'),
       'content' => t('content'),
       'header' => t('header'),
       'footer' => t('footer'),
       'my_new_region' => t('my_new_region')
  );
}

I'll update my readme when I get a chance. Let me know if this does'nt fix the problem.

epieters’s picture

Yep, repeating the default regions in the override is how I fixed it as well.
As far as I'm concerned, only updating the documentation is OK. But I make the assumption that this the intented behaviour.

-- Eric

Anonymous’s picture

Status: Fixed » Closed (fixed)