0

Using views I can create a page with the nid as context and place a primary tab alongside the "View" and "Edit" tab on a node. How can I move it to the seconday tab on the "View" page?

e.g. What I can get

enter image description here

What I need

enter image description here

2 Answers 2

1

Try adding a View page with path

node/%/view/secondary-task

Make it a "Default task" or "Default menu tab" in the View menu settings.

2
  • Nope. that wasn't it. :( Commented Jan 19, 2013 at 0:28
  • Ok, you might also need another tab path below that one at node/%/view/secondary-task/action Commented Jan 19, 2013 at 1:36
1

It is not possible, as the menu structure is missing a menu item.

I have altered a default view the Views module to be visible on node/%/view/backlinks, instead of node/%/backlink; I also changed its menu type to menu tab for an existing menu. The view was not shown.

I then added the following code in my test module.

function code_testing_menu_alter(&$items) {
  $items['node/%node/view/view'] = array(
    'title' => 'View', 
    'type' => MENU_DEFAULT_LOCAL_TASK, 
    'weight' => -10,
  );
}

function code_testing_module_implements_alter(&$implementations, $hook) {
  if ($hook == 'menu_alter') {
    $group = $implementations['code_testing'];
    unset($implementations['code_testing']);
    $implementations['code_testing'] = $group;
  }
}

Once I did that, the view was correctly rendered as sub-tab.

screenshot

In short, showing a view as sub-tab is possible, if there is already a sub-tab. Differently, the view will not be visible.

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.