How do I link the logo to an external site?

本小妞迷上赌 提交于 2019-12-13 05:15:21

问题


I would like to change the link in the Plone logo viewlet. By default it points to the Plone site root, I want to point it to a location that is not within the Plone site.

I tried writing a custom logo viewlet, but this seems very complex for such a small change. What is the best way to do this?


回答1:


The easiest way to change the Logo link is to override the logo viewlet template. This is best done with z3c.jbot.

You need to add z3c.jbot to your projects custom product, by adding it as a dependency in setup.py, and also set up the configure.zcml correctly:

<include package="z3c.jbot" file="meta.zcml" />

<browser:jbot
    directory="templates" />

Don't forget to make sure you have the browser prefix added in the <zcml> tag.

You can now copy the logo.pt file from plone.app.layout to the templates directory in your custom product. Rename the file to plone.app.layout.viewlets.logo.pt and change:

tal:attributes="href view/navigation_root_url;
                title view/navigation_root_title"

To:

href="http://stackoverflow.com"

Restart the server, and the logo link has now changed.



来源:https://stackoverflow.com/questions/17941666/how-do-i-link-the-logo-to-an-external-site

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!