We're going to be adding a block position to a Drupal 6 theme called ShallowGrunge: http://drupal.org/project/shallowgrunge

The Goal

tutuploadsmedia_1273256567138.png

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

tutuploadsmedia_1273256707673.png

Currently there is only a "content" and a "right sidebar" region.

Finding Where to Insert

tutuploadsmedia_1273257642831.png

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

tutuploadsmedia_1273256831165.png

In your site files, navigate to sites / all / themes / shallowgrunge / shallowgrunge.info and open that file

Add the Region Name

tutuploadsmedia_1273257117855.png

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

tutuploadsmedia_1273257231150.png

The file that controls the layout of our theme is page.tpl.php so let's open that up.

Add the Region Code

tutuploadsmedia_1273257391775.png

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:

1.<?php print $header>

Check Your New Region

tutuploadsmedia_1273257562262.png

Check back in Administer >> Site building >> Blocks and your new "header" region should show.

Login to post comments

advertise with us

Boost your traffic and expand your pool of potential customers

8000 active members

Ready to join Now?

CMS Portal - The free marketplace for submitting Joomla, Drupal, Wordpress, Magento, phpBB, Prestashop, vBulletin, Opencart Templates and more.

FOLLOW US

Email Newsletters

Make sure you don't miss interesting happenings by joining our newsletter program.
konya escort eskisehir escort canakkale escort samsun escort balikesir escort aydin escort hatay escort kahramanmaras escort giresun escort tokat escort
Joomla Templates Free Joomla Templates Virtuemart Templates K2 Templates JoomShopping Templates HikaShop Templates SobiPro Templates OpenCart Themes
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes
bettilt
tempobet