Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home Posts plone browser layers

plone browser layers

by Nathan Van Gheem last modified Jan 03, 2009 05: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" />

 

Add comment

You can add a comment by filling out the form below. Plain text formatting. Web and email addresses are transformed into clickable links.

Navigation