menu system

Overriding Menu Page Callbacks

Sometimes you need to override more than a theme function: the entire page needs to be overridden. Drupal 6 makes it rather easy to do this.

In the example below, we call hook_menu_alter(&$callback) to override the display of every single node page view.

Instead of returning a node page, we return "[author's username] is great... for me to poop on.".

 

Loading a Menu, and Theming the Links in Two Lines of Code

When creating a menu [ admin/build/menu/add ] there's a field for "Menu name". We use that value to load whatever array of menu links we want. In this example, we're using "secondary-links" which comes default on most drupal installs.

Subscribe to RSS - menu system