1

It would be very useful to be able to change the "tabs menu" in "menu links" to specific pages and users roles. In order to customize the UI.

I have not found any module for this.

1

One of the ways is to simply change the menu type from MENU_LOCAL_TASK to MENU CALLBACK, and then simply create a menu item with the path.

Sample Code: Cherry pick menu tabs and convert:

function MYMODULE_NAME_menu_alter(&$items) {
  $items['node/%node/view']['type'] = MENU_CALLBACK;
  $items['node/%node/edit']['type'] = MENU_CALLBACK;
}

Convert all at once

function MYMODULE_NAME_menu_alter(&$items) {
  foreach ($items as $key => $value) {
    if ($items[$key]['type'] == MENU_LOCAL_TASK) {
      $items[$key]['type'] = MENU_CALLBACK;
    }
  }
}
  • But in this way I must reconstruct every path. If I wanted to automatically do it? – Daniele Sep 29 '16 at 13:54
  • @Daniele I have updated the answer check now if that works for you. – arpitr Sep 29 '16 at 15:12

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.