用于视图的 Drupal MENU_LOCAL_TASK
想要在选项卡下对两个或更多不同的视图(“页面”样式)进行分组。无法使其工作,选项卡未显示。我想问题是我没有正确定义页面回调。
这就是我尝试过的:
function general_menu() {
$items = array();
$items['people'] = array( // First view has path named "people"
'title' => 'People',
'access arguments' => TRUE,
);
$items['people/list'] = array(
'title' => 'People',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['people/og'] = array( // Second view has path named "people/og"
'title' => 'Groups',
'type' => MENU_LOCAL_TASK,
'access arguments' => TRUE,
'page callback' => 'mymodule_link_to_group_create', // <- maybe wrong
);
return $items;
}
// Not sure I need it
function mymodule_link_to_group_create() {
drupal_goto('people/og');
}
How toproperlydefine“pagecallback”forviews?
谢谢!
Want to group two and more different views ("page" style) under tabs. Can't get it working, tabs didn't show. I guess the problem is that I didn't define page callback properly.
This is what I tried:
function general_menu() {
$items = array();
$items['people'] = array( // First view has path named "people"
'title' => 'People',
'access arguments' => TRUE,
);
$items['people/list'] = array(
'title' => 'People',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['people/og'] = array( // Second view has path named "people/og"
'title' => 'Groups',
'type' => MENU_LOCAL_TASK,
'access arguments' => TRUE,
'page callback' => 'mymodule_link_to_group_create', // <- maybe wrong
);
return $items;
}
// Not sure I need it
function mymodule_link_to_group_create() {
drupal_goto('people/og');
}
How to properly define "page callback" for views?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为什么不在页面设置下的视图中定义菜单?
Why not just define the menu's in the view under Page Settings?
使用Quicktabs 模块可能会更容易。
It might be easier to use the Quicktabs module.