开发者

Local tasks in drupal disappear on one path

开发者 https://www.devze.com 2023-01-12 08:36 出处:网络
I\'m using the notifications module and I\'m trying to move t开发者_StackOverflow社区he notifications profile tab to a secondary tab under the profile/edit tab. I\'ve used hook_menu_alter to add the t

I'm using the notifications module and I'm trying to move t开发者_StackOverflow社区he notifications profile tab to a secondary tab under the profile/edit tab. I've used hook_menu_alter to add the tab under the user/edit path together with User profile and Account, and it appears as it should. But when I press it, both the Account tab and the User profile tab disappear. I only see the primary tabs. Any idea why this happens?


I ended up implementing the tab in hook_menu() as

$items['user/%user/THING'] = array(
  'title' => 'Edit Special THINGS',
  ...,
  'tab_parent' => 'user/%/edit',
);

Two important considerations:

  1. Setting the path to user/%user/edit/THING did not work.
  2. tab_parent works great.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号