[support] Adding Local Action Link
Steve Edwards
killshot91 at gmail.com
Thu Feb 16 18:43:31 UTC 2012
I am building some functionality based on node_clone module that will allow me to clone certain node types and then implement hook_node_clone_alter() to modify some of the node content. I would like to add a couple more links at the top of the page similar to the one node_clone already adds. I've created my hook_menu implementations, cleared the cache, and rebuilt the menus, but the links are not getting added to the $action_links menu.
Here's my code:
/**
* Implementation of hook_menu().
*/
function monographs_menu() {
$items['node/%node/clone/comment'] = array(
'access callback' => 'clone_access_cloning',
'access arguments' => array(1),
'page callback' => 'monographs_node_check',
'page arguments' => array(1, 3),
'title' => 'Create For Comment version',
'weight' => 5,
'type' => MENU_LOCAL_ACTION,
'context' => MENU_CONTEXT_INLINE,
);
$items['node/%node/clone/production'] = array(
'access callback' => 'clone_access_cloning',
'access arguments' => array(1),
'page callback' => 'monographs_node_check',
'page arguments' => array(1, 3),
'title' => 'Create production version',
'weight' => 5,
'type' => MENU_LOCAL_ACTION,
'context' => MENU_CONTEXT_INLINE,
);
return $items;
}
From what I've read and seen in other implementations, this is all I should need. The menu item is created in the menu_router table (I can access it manually from the URL in a browser), and I've verified that the access callback is returning TRUE. It's also getting to my custom callback (when the URL accessed manually), so I know that part is okay. For some reason the links aren't being added to the $action_links variable in page.tpl.php. Is there something else I'm missing?
Thanks.
Steve
More information about the support
mailing list