[Zope3-Users] Re: Traverse to nearest site in menu action

Florian Lindner mailinglists at xgm.de
Sun Apr 3 17:02:51 EDT 2005


Am Freitag, 1. April 2005 22:37 schrieb Stephan Richter:
> On Friday 01 April 2005 11:34, Florian Lindner wrote:
> > Another problem I have, that when I've clicked on home a few times you
> > have a URL like that:
> >
> > http://horus.local:8080/++skin++centershock/cs/++site++/++site++/++site++
> >/+ +site++/++site++
> >
> > Which in IMO is not so great. Any way to normalize this path?
>
> You probably set your base path incorrectly. Anyways, I still think this is
> a horrible way to do it; I would rather build a view that forwards you to
> the site.

Hello,
I've implemented a view like that:

class toSite(object):
    def __call__(self):
        from zope.app.zapi import absoluteURL
        URL = absoluteURL(getSite(), self.request)
        return self.request.response.redirect(URL)

Which for me works perfectly. Any drawbacks of this solution?

Regards,

Florian


More information about the Zope3-users mailing list