[英]Drupal 7 - Add tab link to Node Edit Form
Developing a module for Drupal 7 I can't seem to find how to add a link to neither the horizontal or the vertical tab when editing a node. 为Drupal 7开发模块在编辑节点时,我似乎找不到如何向水平或垂直选项卡添加链接的方法。 I'm pretty sure I have to use hook_menu_alter but still...
我很确定我必须使用hook_menu_alter,但是仍然...
You don't need to use hook_menu_alter
, you can just use hook_menu
to define the new path: 您不需要使用
hook_menu_alter
,只需使用hook_menu
即可定义新路径:
/**
* Implements hook_menu().
*/
function mymodule_global_menu() {
$items['node/%/some_action'] = array(
'title' => 'This Is A new Tab',
'page callback' => 'mymodule_some_action_tab',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK,
);
return $items;
}
Replace some_action
with the actual sub path you want to use, and mymodule_some_action_tab
with the actual callback function for the tab. 将
some_action
替换为您要使用的实际子路径,并将mymodule_some_action_tab
替换为该选项卡的实际回调函数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.