Create custom region in Drupal

by Bhumi //Feb 16,2013 // No comment

Create custom region in Drupal
Share This:Share on FacebookShare on LinkedInTweet about this on TwitterShare on Google+Share on RedditBuffer this pageDigg thisEmail this to someoneFlattr the authorShare on StumbleUponShare on TumblrPin on Pinterest

Drupal is a popular Content Management System.In this tutorial,I will cover how to create custom regions in Drupal 7 themes.Regions in the drupal is same like positions in other cms which is used to define the position of content or block in front.

Drupal provides own pre-defined regions in a theme but sometimes, as per your requirement you want to create new own regions in drupal

So, lets see how to do it.

Steps

1: Go to the theme front theme folder and open yourtheme.info file and put the below code into it.

You can change the above name of region to the any desired name you want which looks like below screen in admin.

admin with custom region

Keep in Mind If newly created region will not display in block section of admin,go to the appearance,select theme and save configuration.

2. Open your theme’s page.tpl.php file and here you need to place the relevant template tags.The regions are rendered using the function render() of Drupal

like here ,I have defined the region bhumi in my themes.info file,so I would add following line of code into the relevant place of page.tpl.php

After that region looks like following screen in front.

regions

Thank you for reading, good luck and let me know if you run in to any problems & I’ll help as much as I can :)

Hope this post will helpful for you, waiting for your responses.Thanks for reading and feel free to share your thoughts! Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

RELATED POST

Installation Database Error in Drupal

Share This: Recently I am working with Drupal and i am trying to install latest version of drupal which drupal 7 and i got the READ MORE

Disable editor from comment in Drupal

Share This: Here is one quick article about how to disable editor display in comment with drupal.When you install any module for editor like ckeditor READ MORE

Two ways to change page template in Drupal 6

Share This: Earlier we have seen “Drupal Basics“.In this article I am going to cover Two ways to change page template in Drupal 6. There READ MORE

Drupal Basic Explained

Share This: When I heard Drupal, First thing comes in the mind is content management system. so First of all, let me explain about content READ MORE

Leave a Reply

Your email address will not be published. Required fields are marked *


9 + three =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">