Drupal 6: How to create a new block region (under title)

Block regions are used to control drupal theme layout. Most of Drupal themes come with five regions:

Left sidebar
Right sidebar
Content
Header
Footer

What if you want more regions? Here I will show you how to create a new one.

To demonstrate, I will create a new block region below content title (above content). I will do it with the core theme -- garland.

Open garland.info ( or any other theme-name.info under your theme directory ), under "engine = phptemplate", inset the following new lines:

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

"Below Title" is the name of the region, replace it with any words you want.

Open page.tpl.php file, under :

	<?php if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif; ?>

add :

	<?php if ($below_title): ?><div class="below-title"><?php print $below_title ?></div><?php endif; ?>

I add code to this section because I want my blow be shown right below the content title. You may adjust the position according to your situation.

Now, flush caches, a new block region below title should have been created.

Post new comment

The content of this field is kept private and will not be shown publicly.