Adding a New Drupal Block Position |
| May 7, 2010 |
We're going to be adding a block position to a Drupal 6 theme called ShallowGrunge: http://drupal.org/project/shallowgrunge The Goal![]() One of our students wanted to put a block position inside the red header bar. If you haven't done so already, download and install ShallowGrunge: http://drupal.org/project/shallowgrunge The Current Blocks![]() Currently there is only a "content" and a "right sidebar" region. Finding Where to Insert![]() I'm using the WebDeveloper toolbar for Firefox to help me identify the red header bar's area. I click on CSS >> View Style Information and then click on the area. The toolbar tells me that the area is called #menu Opening the Files![]() In your site files, navigate to sites / all / themes / shallowgrunge / shallowgrunge.info and open that file Add the Region Name![]() This file contains all the information Drupal needs to know about the theme. Now we're going to tell it about our new region. Currently only two regions are defined in this file. You'll need to add another using this line: regions[header] = Header Open page.tpl.php![]() The file that controls the layout of our theme is page.tpl.php so let's open that up. Add the Region Code![]() We scroll down in the file until we find the div called "menu" and we can insert our block code into there. The syntax is: Check Your New Region![]() Check back in Administer >> Site building >> Blocks and your new "header" region should show. |

Open Source Training is not affiliated with or endorsed by the Joomla, WordPress or Drupal projects.
All product names and trademarks are the property of their respective owners.
Copyright © 2012 Open Source Training, LLC. All rights reserved.
Comments
Thanks for the tutorial. Is it possible to make a region a designated size over an image in the header? I would like to place a language switcher in my header of to the side while sharing it with a header image.
Is this possible?
Thanks