如何使用 drupal 中的自定义模块在 myaccount 页面中创建新选项卡

发布于 2025-01-06 20:02:03 字数 70 浏览 4 评论 0原文

我如何使用 drupal 中的自定义模块在 myaccount 页面中创建新选项卡。是否有任何挂钩?

提前致谢

How can i create a new tab in myaccount page using custom module in drupal.Is there any hooks for that?

thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝颜夕 2025-01-13 20:02:03

选项卡使用菜单项类型MENU_LOCAL_TASK< /代码>MENU_DEFAULT_LOCAL_TASK。要为用户帐户页面添加选项卡,您需要使用其中之一作为菜单项类型,并确保该路径是标准用户路径 (user/%user) 的子路径。

像这样的事情:

$items['user/%user/mytab'] = array(
  'type' => MENU_LOCAL_TASK,
  'title' => 'My Tab',
  'page callback' => 'mymodule_mytab_page',
  'access callback' => 'user_is_logged_in',
  'weight' => 10 // You can control the position of the tab with this property
);

Tabs are handled using the menu item types MENU_LOCAL_TASK and MENU_DEFAULT_LOCAL_TASK. To add a tab for the user account page you need to use one of these as your menu item type, and also make sure the path is a child of the standard user path (user/%user).

Something like this:

$items['user/%user/mytab'] = array(
  'type' => MENU_LOCAL_TASK,
  'title' => 'My Tab',
  'page callback' => 'mymodule_mytab_page',
  'access callback' => 'user_is_logged_in',
  'weight' => 10 // You can control the position of the tab with this property
);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文