plone browser layers
by
Nathan Van Gheem
—
last modified
Jan 03, 2009 12:47 PM
Browser layers are used to specify views and resources and are only specific to your plone site. It is much like what a theme does, you just don't need to select the theme in the site settings. It works on a per site basis and is only enabled when your product is installed.
Specify marker interface for layer
class IMyLayer(Interface): """Marker interface that defines a browser layer """
create a browserlayer.xml file in your GS profile(most likely in profiles/default) directory of your product. The file will look like this,
<layers> <layer name="mylayer" interface="productname.interfaces.IMyLayer" /> </layers>
Now with a viewlet or page you can just specify the layer with it so it only shows up in that layer.
<browser:viewlet name="myviewlet" manager="plone.app.layout.viewlets.interfaces.IPortalTop" class=".viewlet.Myviewlet" layer="productname.interfaces.IMyLayer" permission="zope2.View" />
