Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal Custom Menu Positioning

Tags:

drupal

I've created some custom menus and I'd like to place them somewhere fixed inside my page.php.tpl. How would I do that?

like image 960
n00b Avatar asked Feb 22 '10 16:02

n00b


1 Answers

All "menus" have a "block" for display. You can set a block to display in a specific "region" of your theme on the Administer > Site building > Blocks page. The new menu block will be under "disabled" by default. You can move the block to the desired region and then save the blocks settings. You can also configure the block itself to restrict which user roles or pages it is displayed for.

If your theme doesn't have a region where you want your menu block to show up, then you can add a new region to your theme (steps for Drupal 6):

  1. edit your theme's theme-name.info file, and add on a new regions entry:
    regions[custom_region] = My Custom Region
  2. After clearing cached data via the button on Administer > Site configuration > Performance, your new region should show up as a choice on the Blocks admin page.
  3. You'll also need to output the new region (along with any blocks assigned to it) in your theme's page.tpl.php file, via the new $custom_region variable (The name of this variable will match the text inside the square brackets that you previously added to your theme's .info file.)
like image 183
ashtonium Avatar answered Oct 10 '22 06:10

ashtonium