Skip to main content

plone browser layers

October 17, 2008

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" />