如何添加链接到外部站点的菜单条目?

发布于 2024-12-12 20:19:02 字数 543 浏览 4 评论 0原文

我想向我的克隆站点添加一个主选项卡,该选项卡链接到新窗口中的外部站点。我知道如何在静态 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 技术交流群。

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

发布评论

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

评论(3

紫罗兰の梦幻 2024-12-19 20:19:02

该选项可以在“类型”控制面板页面中找到。

只需选择“链接”类型,您就会看到“立即重定向到链接目标”的选项。我想这就是你要找的。

主题控制面板页面中的选项更多用于内容中的链接,而不是链接对象。

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.

揽清风入怀 2024-12-19 20:19:02

您可以禁用选项卡的自动生成并定义您自己的选项卡。试试这个:

  1. 转到 plone_control_panel ->导航设置
  2. 禁用“自动生成选项卡”
  3. 转到 plone_control_panel -> Zope管理界面-> Portal_actions ->; Portal_tabs。
  4. 使用右上角的菜单,为您需要的每个菜单条目添加一个“CMF 操作”。您可以使用“index_html”作为示例。

操作示例:

标题:W3C

URL(表达式):字符串:http://w3c.org

注意:禁用“自动生成选项卡”不是强制性的,但如果您离开启用后,您的自定义操作将始终出现在所有自动生成的选项卡之前。这可能是一个选择。

更多信息:

You could disable the auto generation of tabs and define your own tabs. Try this:

  1. go to plone_control_panel -> Navigation Settings
  2. disable "Automatically generate tabs"
  3. go to plone_control_panel -> Zope Management Interface -> portal_actions -> portal_tabs.
  4. using the menu in the top-right corner, add one "CMF Action" per menu entry that you need. You can use the "index_html" as example.

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:

南汐寒笙箫 2024-12-19 20:19:02

您还可以使用 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文