On Thu, Oct 7, 2010 at 9:48 AM, Kees Hink <[email protected]> wrote: > How can i display a viewlet only on the site root, also if a content item > (say, > front-page) is selected as the default view? > > * Is there an interface for this? p.a.l.n.i.INavigationRoot and > P.CMFCore.i.ISiteRoot both don't work with items as default views (viewlet > won't show up with front-page as default view - different interface). > > * How can i check in my viewlet code if we're actually on the Plone Site? > The > self.context of the viewlet is front-page, not the site root. Even > self.request > is front-page/document_view >
Look for a interface IContextState, implemented by plone_context_state . This browser view has some nice methods useful int those cases. tal:define="contextstate context/@@plone_context_state" tal:condition="python: contextstate.canonical_object == context.portal_url.getPortalObject()" In the plone.app.layout also have the IPortalState other userful methods, it is implemented by plone_portal_state BrowserView. Thanks, -- Luciano Pacheco blog.lucmult.com.br
_______________________________________________ Product-Developers mailing list [email protected] http://lists.plone.org/mailman/listinfo/product-developers
