Drupal:菜单项标记?
我需要添加带有以下链接的菜单项: user/16/addresses
它是指向用户配置文件选项卡的链接。当然16是用户ID,它应该根据用户而改变。
我可以直接在菜单项中使用令牌吗?例如 [uid] ?
谢谢
I need to add a menu item with the following link: user/16/addresses
It is the link to a tab of user profiles. Of course 16 is the user ID and it should change according to the user.
Can I use tokens directly into menu items ? such as [uid] ?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
hook_menu() 为您完成大部分工作。
当您位于用户页面上并将 UID 放入 URL 时,这将添加选项卡。
据我了解, MENU_LOCAL_TASK 工作于当前 URL,因此您无法用此替换另一个 USER id 到菜单中。
hook_menu() does most of the work for you with this.
This will add the tab when you are on a user page and put the UID in the URL.
As I understand it the MENU_LOCAL_TASK works off the current URL, so you couldn't substitute another USER id into the menu with this.