How to setup different site logo for each hosted conference

If you are hosting multiple conferences within one Plone site, you can easily modify your global_logo template to display appropriate logo for each conference. This was default feature in early versions of the product, but we do not want to change top-level site templates during installation so this feature was disabled.

To use this feature, simply customize your template

/plone/portal_skins/plone_templates/global_logo

with the following code.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" i18n:domain="plone">
<body>
<!-- THE PORTAL LOGO DEFINITION -->
<!-- If the currently displayed conference provides its logo, display it -->
<h1 id="portal-logo-custom" metal:define-macro="portal_logo"
tal:condition="python:hasattr(here,'getConfObject')"
>
    <a href="/"
       tal:attributes="href portal_url"
       tal:define="portal_title portal_properties/title;
                   prefLang python:here.portal_languages.getLanguageBindings()[0]"
       >
      <img tal:condition="python:here.getConfObject().getConflogo()" tal:replace="structure python:here.getConfObject().getConflogo()" />
      <b tal:content="python:here.getConfObject().title_or_id()">plone</b>
    </a>
</h1>

<!-- If displaying the page out of any conference scope, display default site logo -->
<h1 id="portal-logo" metal:define-macro="portal_logo"
tal:condition="python:not hasattr(here,'getConfObject')"
>
<a href="/"
tal:attributes="href portal_url"
tal:define="portal_title portal_properties/title;"
tal:content="string:$portal_title"
accesskey="1">
Plone
</a>
</h1>


</h1>
</body>
</html>
Please note: to be honest, I have not tested this ;-) Please test and report.



Got a Compliation failed when using this code

Posted by Petter Klang at Feb 10, 2007 12:59 PM
Compilation failed
TAL.TALDefs.METALError: duplicate macro definition: 'portal_logo', at line 19, column 1

So you can't use the same macro twice?

Re: Got a Compliation failed when using this code

Posted by David Mudrak at Feb 10, 2007 09:20 PM
No, you can not use the same macro name twice. You have to *customize* the template global_logo, i.e.:
1) go to the ZMI
2) find your Plone's portal_skins/plone_templates/global_logo template
3) click on "Customize" button
4) edit the customized copy of the template