- Accessibility
- Actions
- Blog
- Bootstrap
- Calendar
- Code Snippets
- Core Hacks
- Cron
- Development Environment
- Drupal 7
- Flash
- Forms
- Goodies
- Hooks
- Hosting
- Images
- Installation, Updating and Moving
- Internationalization
- Javascript/JQuery
- Learning Drupal (New Users)
- Login/User Management/Permissions
- Logs
- Menus
- Modules
- Nodes
- Paths
- Performance
- RSS
- Reference Sites
- Registry
- Reporting
- Reporting Bugs/Issues
- SEO
- Schema
- Search
- Security
- SimpleTest
- Sites
- Support
- Testing
- Themes
- Troubleshooting
- Upgrading
- User Groups
- Workflow
Submitted by captaindav on Tue, 2009-07-14 13:42
To create and display a custom menu in a Drupal template, do the following:
1. Create the new menu by clicking "Add Menu".
2. Remember the machine readable name you specified.
3. Add the menu items.
4. In your template, enter the following code, replacing "machine-readable-name" with the name you entered in step 2. Note that Drupal adds "menu-" in front of the machine readable name you specified, so be sure to pre-append "menu-" in front of your machine readable name.
<?php print theme('links', menu_navigation_links('menu-machine-readable-name'), array('id' => 'menu_id', 'class' => 'menu_class')); ?>