Drupal Custom Menu Positioning
I've created some custom men开发者_开发技巧us and I'd like to place them somewhere fixed inside my page.php.tpl. How would I do that?
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):
- edit your theme's theme-name.info file, and add on a new regions entry:
regions[custom_region] = My Custom Region
- 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.
- 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.)
精彩评论