Book Image

Drupal 7 First Look

Book Image

Drupal 7 First Look

Overview of this book

Drupal 7 contains features for which site administrators have been clamoring for years, including support for fields, an improved administration interface, better database support, improved theming, and more. You could of course make a laborious search on sites, blogs, and many online tutorials that would promise to update you about every new feature, but there's an even better way to know all about Drupal 7's new features: Drupal 7 First Look is the first and only book that covers all of the fantastic new features in Drupal 7 in depth and covers the process of upgrading your Drupal 6 site to Drupal 7. If you've used Drupal 6 and want to use Drupal 7, you need this book.Drupal 7 First Look takes an in-depth look into all of the major new features in Drupal 7 so you can quickly take full advantage of Drupal 7. It also assists you in upgrading your site to Drupal 7. Some of the new features in Drupal 7 include: Fields API, based on Drupal 6 CCK, which allows you to easily build your own content types Improved user interface for administering your website Built-in support for working with images and files Improved security for the site and users of the site Completely rewritten database layer DBTNG to make working with the database easier and more secure. Improved API for custom module development and user interface theming
Table of Contents (13 chapters)
Drupal 7 First Look
Credits
About the Author
About the Reviewer
Preface
Index

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 to access the path or true if they are allowed to view the path.

file

The path to a file that can be included before the path_callback is executed.

page_callback

The callback to execute to generate the content of the path or perform needed...