ploneplone-4.x

How do I link the logo to an external site?


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?


Solution

  • 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.