How does adding links/menu items work in Drupal?
June 16, 2009 9:57 AM   Subscribe

How does adding links/menu items work in Drupal?

I'm writing a module which is an extension of Content Profile. There are two version of your profile - Default and Extra. You can set a field to either be 'default', 'extra', or both. If you access your profile through /user/1/edit/profile, a form_alter hook removes all of the fields that are only marked Extra before the content is displayed on the page. Similarly, when you go to /user/1/edit/profile_extra the fields marked as Extra are displayed.

By assigning the normal edit-profile link value to $items['user/%user/edit/profile_extra'] and switching on $form_id and $form['#action'] I can get the profile_extra page to show up when I visit its URL. But how do I get it to show up in all of the places that content_profile gets the Profile link? And how do I add all of those submenus that are on /user/%user/edit/profile?

anonymous thanks to bosses. mail can go to
posted by anonymous to Computers & Internet (2 answers total) 1 user marked this as a favorite
I found this book very helpful last time I wasn't getting along with Drupal.
posted by soma lkzx at 11:58 AM on June 16, 2009

I think you might want hook_menu_alter, but I'm not really familiar with the Content Profile module, and it's been a while since I've futzed around with the D6 menu system in a custom module.

I'd have a good hard look at the entire menu system handbook section, as well as the API docs and how Content Profile is doing its own menu stuff.
posted by romakimmy at 8:30 AM on June 17, 2009

« Older How to repeat a sequence of roughly 40 keyboard...   |   Does Not Compute Newer »
This thread is closed to new comments.