Home ›
Printing a menu in a themePrinting a menu in a theme
Submitted by Benjamin Melançon on October 3, 2007 - 11:22am
Searched words:
phptemplate create region
menu ID
print another menu
Fellow in IRC asking for ways to print out a third menu, not primary or secondary links but a completely different one, without creating another region, putting just one menu block in it.
I recalled Agaric had done that...
Resolution
This is the way we did it in InternetBarContest. I think there are acouple menu theming functions, not sure how different ones would work with this. In page.tpl.php:
<?php print theme('menu_links', menu_primary_links(0,2)); ?>
The two is replaced by the menu id of the menu you want to print.
More like this
- Printing an arbitrary menu just like primary_links and secondary_links
- Print a form, such as a search form, anywhere in Drupal
- Where in the theme are the tabs printed / giving tabs to admins only
- How to print views from a theme: use PHP to insert views directly into a template
- Print information associated with a node elsewhere in page.tpl.php, using a separate template file for theming


Comments
Post new comment