1

I have on user account 5-6 tabs created by some modules.My wish is to covert these tabs to menu items so as to insert to 2 separate menu links. I have read that something like that could be possible with hook_menu_alter. Is this correct?If so,how can I use it in my case? thanks a lot

  • Your question is unclear, you have provided no examples and no information about the modules used to generate tabs. Are tabs li elements of the same menu? Tabs as menu items with 2 separate menu links? Links are under items, am I correct? So 5-6 tabs in 2 items or 2 menus? – designarti Jun 20 '15 at 20:45
  • Okay,the tabs are being created on the User account by Hybrid auth module,Userpoints,Commerce credits,Commerce(Orders tab),Search api saved searches etc.I am interested in removing these tabs from user account page and instead place them as menu items in 2 menus,half of them to one menu and the other half to the other menu.I hope this makes more sense. – sokratis Jun 20 '15 at 20:50
  • You will have to write a module to do all this stuff. Get all items from respective modules and aggregate them in two separate menus, publish them on the user page and unpublish tabs from your user pages. These menu items are probably dinamically generated, using tokens or abstract url links behind. – designarti Jun 20 '15 at 21:08
  • Shall I do this with hook_menu_alter?If yes,could you give me an example?thanks – sokratis Jun 20 '15 at 21:14
2

By creating an extremely simple custom module, you can Remove tabs using hook_menu_alter. Make sure to also clear the cache when you experiment with this.

Note: Consider refining your question to specify the path of each of those tabs you want to replaced.

  • Great,thank you ,I will try with hook_menu_alter,if I have any questions I will post here.Thanks again – sokratis Jun 20 '15 at 21:17
  • ok, I'll be curious to hear how it turned out ... – Pierre.Vriens Jun 20 '15 at 21:19
  • Hm I tried with hook_menu_alter,it doesn't remove the tab,instead it restricts access to the path.What am I missing? The code is here function custom_menu_alter(&$items) { $items['users/%user/hybridauth']['type'] = MENU_CALLBACK; } – sokratis Jun 21 '15 at 12:24
  • Anyway,I think I will do this with the Tab tamer module – sokratis Jun 21 '15 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.