Thursday

Adding a New Drupal Block Position

Version: drupal 7

This article describes a simple way to define a new region in your theme.
Let's assume that we need to place a block above the main menu, as advertisement or news bar.


1- First open the info file for your theme.

For example if you use the " analytic " theme, then open analytic.info file:

sites/all/themes/analytic/analytic.info


we'll call the new region : above menu


So add a definition for this region in the file and write: regions[above_menu] = Above Menu



2- Now all you need is to add the code to print the content of this region.

Open page.tpl.php file and find the code that print the menu: "main menu " , add the following code above it:

That's all.. Go to structure --> Blocks , you'll find new "Above Menu " region.

Add your block in this region and enjoy!!