Drupal菜单\本地\视图任务

Drupal菜单\本地\视图任务,drupal,drupal-views,Drupal,Drupal Views,希望在选项卡下对两个或更多不同的视图(“页面”样式)进行分组。无法使其工作,选项卡未显示。我想问题是我没有正确定义页面回调 这就是我所尝试的: function general_menu() { $items = array(); $items['people'] = array( // First view has path named "people" 'title' => 'People', 'access arguments' =>

希望在选项卡下对两个或更多不同的视图(“页面”样式)进行分组。无法使其工作,选项卡未显示。我想问题是我没有正确定义页面回调

这就是我所尝试的:

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');
}
功能常规菜单(){
$items=array();
$items['people']=数组(//第一个视图的路径名为“people”
“title”=>“People”,
“访问参数”=>TRUE,
);
$items['people/list']=数组(
“title”=>“People”,
'类型'=>菜单\u默认\u本地\u任务,
);
$items['people/og']=数组(//第二个视图的路径名为“people/og”
“标题”=>“组”,
“键入”=>菜单\u本地\u任务,
“访问参数”=>TRUE,
“页面回调”=>“mymodule\u link\u to\u group\u create”,//
。。。
$items['people/og']=数组(//第二个视图的路径名为“people/og”
“标题”=>“组”,
“键入”=>菜单\u本地\u任务,
“访问参数”=>TRUE,

“页面回调”=>“mymodule\u link\u to_group\u create”,//为什么不在页面设置下的视图中定义菜单?

可能更容易使用。

是的,这是我想到的第一件事,但它不起作用。您还可以将
视图\u embed\u视图设置为页面回调,并通过
页面参数=>数组发送参数(“您的视图名称”、“显示ID”)
...
    $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
    );

...

function mymodule_link_to_group_create() {
  return views_embed_view('YOURVIEWSNAME', 'DISPLAYID'); // displayid usually default
}