How to Add a Region

dailypress - October 2, 2009 - 20:08

I had found the instructions on how to add a region (for example one under the Title of each page and above the main content) in a book I returned. I was wondering if anyone knows the link of an instruction (step by step) page or is willing to write how to do it.

I think its very useful and many can benefit from it. I couldnt find it when I did a search on /How to Add a Region/

tnx in advance,

if no replies, Ill have to go get the book back next week and will write it here myself :)

See Assigning content to

nevets - October 2, 2009 - 21:24

...

dailypress - October 4, 2009 - 18:44

thank you Nevets.

Its very similar to what I was looking for. however, Im not looking for how to manually add content to regions but actually how to define a new region.

I remember the book saying to add line to the default .info file of your theme (i.e. Marinelli.info) :
regions[left] = Left sidebar
regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer

for example:
regions[title] = title

and then a new region should show up in the Block page called Title.

p.s.> my Marinelli.info looks a bit different from what I remember the book had said! I think its cause the book was a bit old and maybe isnt up to date with the new themes!

Then you would use the 'print Title block' code somewhere in the theme depending on location. (in my case I would like to add a new block for advertisement purposes to under the Title of each page)

I noticed my new marinelli theme doesnt list the default regions and when I add them myself (including the new Title one I define) it still doesnt show up on the admin block page.

any other links? or step by step instructions on how to ADD a New Region in your Theme?

In short im trying to add a new region for the admin block section!

...

Jeff Burnz - October 4, 2009 - 18:52

I say this is a well covered topic - never heard of Google?

_

WorldFallz - October 4, 2009 - 18:55

Afaik, that's the only page that addresses this for d6. It may not be very clear, but the info is buried in the page. Since marinelli only uses the default regions you need to add all the regions to add a custom one (and yes, that was mentioned on the page somewhere, lol):

regions[left] = Left sidebar
regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer
regions[title] = Title

Then just open up the page.tpl.php file and print the $title region variable where you want it to appear (see the other regions in the file for the syntax). I'm not sure about naming your region "$title" though-- I believe there's already a variable in page.tpl.php named that. To be safe, I would name it something else.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

thank you guys! Im all set

dailypress - October 10, 2009 - 18:12

thank you guys! Im all set and finally fixed it with your help! :)

p.s.> Yes, I think I have heard of Google! ;) I followed the steps but it never worked but now it does thanks to the posts. the problem I was facing was updating the .info of the wrong folder.

I am using a template which is a subfolder of Marinelli but I was changing the .info of Marinelli root folder and noticed nothing changed!
But when I changed the .info in the Giordani folder it worked!

 
 

Drupal is a registered trademark of Dries Buytaert.