开发者

Drupal 6: how to display node with its local tasks tabs in menu item

开发者 https://www.devze.com 2023-01-03 23:51 出处:网络
In my case each user has a gallery. Gallery is a node. I\'d like to hide default \"Create content\" menu and add custom men开发者_运维知识库u link that links to user gallery.

In my case each user has a gallery. Gallery is a node. I'd like to hide default "Create content" menu and add custom men开发者_运维知识库u link that links to user gallery.

function custom_menu() {
  $items = array();
  $items['galleries/editgallery'] = array(
    'title' => 'Edit gallery',
  'description' => 'edit gallery',
    'page callback' => 'custom_edit_gallery',
    'access callback' => 'custom_access_editgallery',
  );
  return $items;
}

function custom_edit_gallery (){
  global $user;
  $node = node_load ($user->gallerynid);
  return node_page_view ($node);
}

But it doesn't show local tasks tabs(like "Edit" tab).


You would need to add them yourself.

  • With normal theming, you could create a custom template file or overwrite a theme function etc to add the tabs you want.
  • You could also do this within hook_menu, by using MENU_LOCAL_TASK and MENU_DEFAULT_LOCAL_TASK, see the api.
0

精彩评论

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