This site is archived.

Drupal 6 menu system - architecture, do, don't and tricks

pwolanin's picture
Submitted by pwolanin on Mon, 06/30/2008 - 04:32.

Session recording

Attached files

Co-presenters: 
Placement
Session time: 
08/27/2008 - 16:00 - 08/27/2008 - 16:45
Conference booklet summary and bio
Article for conference booklet: 
The Drupal 6.x menu system has a fundamentally different architecture from what was present in Drupal 5.x. This session is designed to highlight the key features of the new system, give some some detailed code examples, and maybe a little flavor of Drupal Tough Love as we scour the current contributed modules for examples of ugly, broken, or just-plain-wrong menu code. We will discuss how does Drupal 6 serves paths and render links. These two functions are now decoupled,however the fact that some links are created automatically creates a potentially confusing appearance of unity. We will discuss the different menu hooks and when they are invoked, and spend some time on the features and limitations of what you can define for a router item using hook_menu. You should be familiar with writing a hook_menu implementation and preferably the {menu_router} and {menu_links} tables to get the most of this session. Much of the content of this session will be code examples and explorations of core code. By the end we hope to help you throw off the shackles of your Drupal-5.x-based thinking about the menu system and be ready to use the features and be aware of the limitations of the Drupal 6.x menu system.
Bios for conference booklet: 
Peter Wolanin, known as pwolanin on drupal.org, has been contributing to Drupal core since 2005 and recently joined Acquia as a senior engineer (Momentum Specialist). Prior to that, Peter earned his Ph.D. in Physics and did biophysics and molecular biology research. Peter worked with Károly to write several of the new pieces of the Drupal 6 menu system, and also re-wrote the Drupal 6 Book module to use the new menu API. Károly Négyesi, better known in Drupal circles as chx, has been a core developer since 2004 and developer team lead of NowPublic. He currently maintains (and wrote significant parts of) the form API subsystem and the menu subsytem. The community sometimes accuses him of not sleeping, to which he answered "I code core to be high without resorting to harmful drugs". Thus, the community thinks he can not be distracted, and runs http://chxcannotbedistracted.com which he finds very amusing.

Overview

The Drupal 6 menu system has a fundamentally different architecture from what was present in Drupal 5. This session is designed to highlight the key features of the new system, and give some code-level examples of how to use them well and what to avoid.

Agenda

* How does Drupal 6 serve paths and render links
* When are the menu hooks called
* When to define a router item
* Examples of bad code
* Examples of good code
* Advanced tricks and tips

Goals

By the end of this session I hope you will have thrown off the shackles of your Drupal-5-based thinking about the menu system and be ready to use the features and be aware of the limitations of the Drupal 6 menu system.

Resources

You should be familiar with writing a hook_menu implementation and preferably the {menu_router} and {menu_links} tables to get the most of this session

darrenmuk's picture

As what seems like the

As what seems like the biggest difference between developing for D5 or developing for D6, I am looking forward to this session.