Drupal 面板页面 Pathauto
我使用路径 node/%node/foo
设置了一个面板页面,当我访问 node/6/foo
等链接时,一切正常。但是,当我访问 nodealias/foo
时,它根本不起作用。是否可以让面板以这种方式与 pathauto 一起工作?
我想我可能必须实现钩子 hook_url_inbound_alter 并自己更改 url。
我还在此处的面板模块中发布了支持请求:http://drupal.org/node/1219796
I have a Panel Page set up with the path node/%node/foo
and all works fine when I visit a link such as node/6/foo
. However, when I visit nodealias/foo
it doesn't work at all. Is it possible to get panels to work with pathauto in this way?
I am thinking I may have to implement the hook hook_url_inbound_alter and change the url myself.
I also posted a support request in the panels module here: http://drupal.org/node/1219796
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
由于 Alexey 回答面板不关心别名,它只看到节点/%nid
这是一个对 D7 仍然有效的很好的解释:
http://drupal.org/node/211338
总结并更新 D7:
导出您创建的面板的变体并将其导入到覆盖 Drupal 中默认节点显示的面板中。
将条件添加到变体中,以便面板/变体仅用于您想要使用此变体显示的内容类型。
瞧:)(阅读链接上的讨论,否则摘要将很难理解)
希望这会有所帮助 - 我自己花了一些时间谷歌搜索并试图理解这一点,而且我也对 Views 确实关心的事实感到困惑别名...
As Alexey answers panels doesn't care about aliases, it only sees node/%nid
Here's a good explanation that is valid still for D7:
http://drupal.org/node/211338
To summarize and bring it up to date for D7:
Export your variant for the panel you've created and import it into the panel that overrides the default node display in Drupal.
Add Criterias to the variant so the Panel/variant is only used for the type(s) of content you want to display with this variant.
Voila :) (read the discussion at the link, else the summary will be difficult to understand)
Hope this helps - I myself have spend some time googling and trying to understand this, and I was also confused by the fact that Views DOES care about aliases...
我使用以下代码修复了此问题,您需要更改模式以匹配您的 url 别名的模式,并更改函数名称以匹配您的模块名称。
I fixed this using the following code, you would need to alter the pattern to match the pattern of your url aliases and alter the function name to match your module's name.
您可以使用此模块 Subpathauto
它会自动使别名与子路径一起使用,例如:
nodealias /foo
You can use this module Subpathauto
it automatically makes the alias to work with subpaths, such as:
nodealias/foo
nodealias 是 nid=6 的节点的完整别名。第三个参数 (foo) 由 panel 模块通过 hook_menu() 添加到确切的别名 (node/%nid/%anythingelse),并且它不会应用于您的别名 URL,因此您不能使用 nodealias/foo url 来访问您的面板只是因为它没有被面板模块“挂钩”。
我认为手动更改 url 是个好主意。
The nodealias is the full alias of your node with nid=6. The third argument (foo) is added through hook_menu() by panels module to the exact alias (node/%nid/%anythingelse) and it is NOT applied to your aliased URL, so you can not use nodealias/foo url to access your panel just because it is not 'hooked' by panels module.
Changing url manually is a good idea, I think.