0

I’ve made a tabbed display out of my Local Task Menu as imaged.

Some of the extra buttons are ‘pages’ as made with ‘pages manager’ . Here you can assign the page to the Local Menu; when doing so by this method the created page also shows with these user tabs.

However a couple of pages ( one created by the Nodequeue and the other a Custom Module made by myself ) ; with these I’ve assigned to MENU_LOCAL_TASK in hook_menu_alter . And although they show up in the menu when clicked on they no longer have the Local Task Menu. Does anyone know a way I can force these pages to show it ?

Many thanks

0

I managed to solve this be engineering a fix with ( https://www.drupal.org/project/local_tasks_blocks )

There is a patch here at https://www.drupal.org/node/2141653 for 'Fixed path for displaying tabs' which sounds like the same issue I had . However the patch didn't work for me.

Checking the value of $tasks['#primary'] ; I concluded that if I could keep this array for a session then I could use the Local Tasks Menu on all the pages I wished while the User is logged in. Ie something like

if (empty($tasks['#primary'])) {

// 1.  Check the cookies if we have one then use that
if (isset($_SESSION['usertasks']['primary'])) {

$tasks_primary = $_SESSION['usertasks']['primary'];
$tasks['#primary'] = $tasks_primary;
}
else {
$usertasks = &$_SESSION['usertasks'];
// well need to create a new instance of this array so we don't    effect it for the page we're on
$tasks_primary = $tasks['#primary'];
$usertasks['primary'] = $tasks_primary;
  }
}

My next step is to make a patch for this if anyone else may find it of use.

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.