[Plone-UI] Hello, and logo.jpg/tag question

Alvaro Medina alvaromg at gmail.com
Wed Jun 18 13:45:05 UTC 2008


Hi, my name is Alvaro Medina, from Chile, I've been working with Plone
for about 4 years.

I am trying to customize the logo.pt viewlet in Plone 3. I need to use
2 logos, 1 for homepage and 1 for internal. Currently I'm doing this
via CSS, hiding the default Plone <img> tag in the logo and placing
the custom logos in the pre-3 way (with <a>, etc).

I tried to set 'my-logo.png/tag' in the logo.pt template, however it
throws an error.

What i did was add to viiewlets.py:

# logo
class LogoViewlet(common.LogoViewlet):
    render = ViewPageTemplateFile('templates/logo.pt')
    def update(self):
        super(LogoViewlet, self).update()

        portal = self.portal_state.portal()
        logoName = 'tlf-logo.png'
        self.logo_tag = portal.restrictedTraverse(logoName).tag()

where 'tfl-logo.png' is the name of one of the logo images.

I couldnt catch all the error output, this are the last lines:

    self.logo_tag = portal.restrictedTraverse(logoName).tag()
  File "/home/alvaro/ifprepo/instance20-alvaro/parts/zope2/lib/python/OFS/Traversable.py",
line 301, in restrictedTraverse
    return self.unrestrictedTraverse(path, default, restricted=True)
  File "/home/alvaro/ifprepo/instance20-alvaro/parts/zope2/lib/python/OFS/Traversable.py",
line 284, in unrestrictedTraverse
    raise e
KeyError: 'tlf-logo.png'


I'd appreciate any clue on this. Thanks and regards,
Alvaro Medina
Santiago, Chile




More information about the UI mailing list