I'm currently trying to build a viewlet-based menu. As any common menu, it
should consist of entries, which link in my case to certain object views. If
such a link is clicked, the menu entry should change (no link) to denote that
the entry is selected.
Therefore I built a base class that looks like the following:
site_path = absoluteURL(getParent(getSiteManager(self)), self.request)
self.link = site_path + self.link
render = ViewPageTemplateFile('pt_desktop/menuentry.pt')
current_url = absoluteURL(getParent(getParent(self)), self.request)
if current_url == self.link:
The page template either returns an entry with a link or without one,
regarding to view/iscurrent. Now I can inherit menu entries and configure
them to show up in the menu like this:
label = u"Startseite"
link = "/index.html" # Relative to my Site Object
My problem is that the update() function which sets the link does not always
work. The link should always include the URL of the local site object, which
is does not when a 404 page is displayed, therefore all menu entries have
Does anyone know why, or does someone have a better suggestion to my problem?
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9 4902 64B4 D16B 2998 93C7
Zope3-users mailing list