如何添加链接到外部站点的菜单条目?
我想向我的克隆站点添加一个主选项卡,该选项卡链接到新窗口中的外部站点。我知道如何在静态 html 页面中执行此操作,但我不确定如何以“Plone”方式执行此操作。当我将链接内容类型添加到我的主文件夹时,该链接仅在当前浏览器中进行重定向。
最终,我希望在主导航选项卡之一(以及我的其他主 Plone 选项卡)中提供该链接,但我不确定如何做到这一点。是否有任何内置功能可以处理这种情况?
我查看了 Products.CMFPlone.skins.plone_content.link_redirect_view.py 下的代码,我相信链接内容类型可以正常工作。看来该链接是通过执行此方法生成的:
return context.REQUEST.RESPONSE.redirect(context.getRemoteUrl())
How can I add a new type that does the same thing but just opens in a new window?
我目前在 CentOS 5.3 和 Plone 4.1.2 上运行。
I would like to add a main tab to my plone site, that links to an external site in a new window. I understand how to do this in a static html page, but I'm unsure how to do this the "Plone" way. When I add a link content type to my home folder, the link just does a redirect in the current browser.
Ultimately, I'd like to have the link available in one of the main navigation tabs (along with my other main Plone tabs), but I'm not sure how to do that. Is there any built-in functionality to handle this scenario?
I took a look at the code under Products.CMFPlone.skins.plone_content.link_redirect_view.py where I believe the link content type works. It appears that the link is generated by doing this method:
return context.REQUEST.RESPONSE.redirect(context.getRemoteUrl())
How can I add a new type that does the same thing but just opens in a new window?
I'm currently running on CentOS 5.3 and Plone 4.1.2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
该选项可以在“类型”控制面板页面中找到。
只需选择“链接”类型,您就会看到“立即重定向到链接目标”的选项。我想这就是你要找的。
主题控制面板页面中的选项更多用于内容中的链接,而不是链接对象。
This option can be found in the Types control panel page.
Just select the "Link" type and you should be presented with the option to "Redirect immediately to link target." I think that's what you're looking for.
The option in the Themes control panel page is more for links in content, not link objects.
您可以禁用选项卡的自动生成并定义您自己的选项卡。试试这个:
操作示例:
标题:W3C
URL(表达式):字符串:http://w3c.org
注意:禁用“自动生成选项卡”不是强制性的,但如果您离开启用后,您的自定义操作将始终出现在所有自动生成的选项卡之前。这可能是一个选择。
更多信息:
You could disable the auto generation of tabs and define your own tabs. Try this:
Action example:
Title: W3C
URL (Expression): string:http://w3c.org
Note: disabling "Automatically generate tabs" is not mandatory, but if you leave it enabled then your custom actions will always appear before all auto generated tabs. It could be an option.
More info:
您还可以使用 ZMI 中的
portal_actions
创建新的导航选项卡。在 URL 表达式字段中输入站点 URL。即'字符串:http://www.thesite.com'
。新选项卡将出现在您的顶部导航中,并将直接链接到您指定的网站。有关更多信息,请查看此处 - http://plone.org/documentation/kb/changing-tabs
You can also use
portal_actions
in the ZMI to create a new navigation tab. In the URL expression field enter the site URL. i.e.'string:http://www.thesite.com'
. The new tab will appear on your top navigation, and will link straight to the site you specify.For more info have a look here - http://plone.org/documentation/kb/changing-tabs