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 askme4635646456@gmail.com
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 askme4635646456@gmail.com
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
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
This thread is closed to new comments.
posted by soma lkzx at 11:58 AM on June 16, 2009