O'Reilly logo

Drupal 7 First Look by Mark Noble

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Menu system changes

Now that we have covered some of the general changes to the API in Drupal 7, we can begin looking at specific areas that have changed. Let's start by looking in more detail at how the menu system has changed in Drupal 7. The menu system is critical to making content appear on your site.

New hooks

Let's begin by looking at some of the new hooks, which relate to the menu system, that you may want to implement in your module:

hook_menu_active_handler_alter

hook_menu_active_handler_alter(&$router_item, $path = NULL)

This hook allows you to change how a menu is handled by the module system. You can set the following keys within the router_item array:

Property

Description

access

Set to false if the user should not be allowed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required