开发者

Can I combine Views page tabs with module generated tabs?

开发者 https://www.devze.com 2023-01-23 08:06 出处:网络
I have created a View with multiple page displays. I have specified one as the \"default tab\" and the other two as \"tab\" and they all display c开发者_如何学Pythonorrectly together on a page similar

I have created a View with multiple page displays. I have specified one as the "default tab" and the other two as "tab" and they all display c开发者_如何学Pythonorrectly together on a page similar to this:

Can I combine Views page tabs with module generated tabs?

I would like to be able to insert another tab onto this page with module generated code (not from a view). Is this possible?


Using the menu hook you can define another tab for the page similar to below:

function MODULENAME_menu() {
  $items = array();

  $items['PATH_TO_VIEW_DEFAULT_TAB/YOUR_NEW_TAB'] = array(
    'title' => 'TAB TITLE',
    'page callback' => 'FUNCTION NAME',
    'page arguments' => array('ACCESS ARGUMENT'),
    'access callback' => 'user_access',
    'access arguments' => array('ACCESS ARGUMENT'),
    'type' => MENU_LOCAL_TASK,
    'weight' => 10
  );
  return $items;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消