Add regions to a theme

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'nodereference_autocomplete_access' was given in /home/mnnnecdq/public_html/drupalme/includes/menu.inc on line 452.
Thursday, November 5, 2009 - 09:42

At first it was a little confusing, but after reading about .info files and studying the garland theme I gave it a try. In my case I needed to print some content on my frontpage, there was not enough regions available so I had to create my own.

The theme's info file is the place to start. It is within you're theme folder and is called themename.info. Default regions is listed here and to create new ones use the same style as the default, just copy them and rename (add as many as you like).

When updating a theme info-file you have to visit the Site building theme section so that Drupal can check for updates, in some cases you might need to clear cache. To see if the new regions is available visit Site building Blocks and click one of the select menus, you're new regions should be listed if you have done everything right.

Important! You can not use "special letters" like æ,ø,å inside the info files.

1. This is my desired layout.
2. Default regions
3. My custom regions
4. After saving the info file visit Site building Themes so that Drupal can check for updates. It could take som time to load the theme page at this point.
5. Visit the block page and click the select menu underneath Region. You're new regions should be available in the selection menu.
6. The last step is to tell page.tpl.php or page-front.tpl.php (depending on what you're using) that there are new regions available. Manually add the regions to the tpl file like this.

Comments

Great Article

Great Article very helpful.
Thank you so much.

Add comment

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