I created a panel page using the Panels module, Contact list at the path messages/contact-list
.
The Privatemsg module causes several tabs (Inbox, Sent messages, All messages) to be displayed across the top of pages with path messages
. I am attempting to add an additional tab that links to my Panels page, Contact list.
Based on the code in privatemsg.module for the "Sent messages" tab:
$items['messages/sent'] = array(
'title' => 'Sent messages',
'page callback' => 'privatemsg_list_page',
'page arguments' => array('sent'),
'file' => 'privatemsg.pages.inc',
'file path' => drupal_get_path('module', 'privatemsg'),
'access callback' => 'privatemsg_user_access',
'type' => MENU_LOCAL_TASK,
'weight' => -12,
'menu_name' => 'user-menu',
);
I added this code to hook_menu()
in a custom module:
$items['messages/contact-list'] = array(
'title' => 'Contact List',
'page callback' => 'drupal_goto',
'page arguments' => array('messages/contact-list'),
'access callback' => 'privatemsg_user_access',
'access arguments' => array('read privatemsg'),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
'menu_name' => 'user-menu',
);
However, although this produces no errors, even after clearing the cache multiple times no tab appears anywhere. I tried moving the code from my custom module into the privatemsg module to no effect. I've looked at the documentation for hook_menu() but it still isn't clear to me what I'm doing wrong.
return $items;
was one thing that caused me to face this problem many times :) and I've seen better and more experienced people than me do this too, so I'd suggest that its worth a check, also suggest checking if there is an entry formessages/contact-list
in themenu_router
table with the respective arguments to gain some insight. – optimusprime619 Apr 19 at 6:58return $items
; there is an entry in themenu_router
table withctools_access_menu
as the access callback andpage_manager_page_execute
as the page callback. I don't really understand what that means though. – Patrick Kenny Apr 19 at 8:41