0

I have a menu structure like this:

  • $items["foo"] -> MENU_NORMAL_ITEM
  • $items["foo/bar"] -> MENU_DEFAULT_LOCAL_TASK
  • $items["foo/something"] -> MENU_LOCAL_TASK
  • $items["foo/bar/bazz/%"] -> MENU_CALLBACK

I want to have the tabs (local tasks) from page foo/bar displayed on foo/bar/bazz/% as well but I don't want to have another local task for this new page.

Any ideas on how can I achieve that? Thanks.

1 Answer 1

0

I kinda managed to to this by using the following piece of code:

$path = drupal_get_normal_path('path-where-local-tasks-are-displayed');
if($path) {
  menu_tree_set_path("navigation", $path);
  menu_set_active_item($path);
}
2
  • Hi Marius; thanks for the reply. I can't quite get this to work. My menu id is 'tasks' and the path mydomain.com/user . So should this code work on my front page for example if ($is_front): $path = drupal_get_normal_path('user'); if($path) { menu_tree_set_path("navigation", $path); menu_set_active_item($path); } endif;
    – Deejay
    Sep 23, 2014 at 7:59
  • not quite sure about the user tabs but I think it should be: $path = drupal_get_normal_path('user/user_id') and then menu_tree_set_path("navigation", $path); Sep 23, 2014 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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