Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In addition to theme-specific viewlets, mentioned by @user276028, you can create browserlayers for non-theme viewlets:</p> <p>Example taken from <a href="http://pypi.python.org/pypi/collective.atimage.transformtoolbar" rel="nofollow">collective.atimage.transformtoolbar</a>:</p> <ol> <li><p>Create a <strong>browserlayer</strong> (you can create them with paster localcommand <code>addcontent browserlayer</code>):</p> <ul> <li>Add an <a href="http://dev.plone.org/collective/browser/collective.atimage.transformtoolbar/trunk/collective/atimage/transformtoolbar/interfaces.py" rel="nofollow">interface for the layer</a>.</li> <li>Create a <a href="http://dev.plone.org/collective/browser/collective.atimage.transformtoolbar/trunk/collective/atimage/transformtoolbar/profiles/default/browserlayer.xml" rel="nofollow">browserlayer.xml</a> file GenericSetup to register it as a layer.</li> </ul></li> <li><p>Use the layer in viewlet registration:</p> <ul> <li>Edit your viewlet registration in configure.zcml with a <a href="http://dev.plone.org/collective/browser/collective.atimage.transformtoolbar/trunk/collective/atimage/transformtoolbar/browser/configure.zcml#L37" rel="nofollow">layer attribute</a> pointing to your interface.</li> </ul></li> </ol> <p>In the configure.zcml linked file you can also see how to show the viewlet just for some content types (<code>for</code> property) and just for default view of that content type (<code>view</code> property).</p> <p>Any other case, I think you should decide when to show/hide your viewlet code or template, like in the <a href="http://dev.plone.org/collective/browser/collective.atimage.transformtoolbar/trunk/collective/atimage/transformtoolbar/browser/viewlets.py#L12" rel="nofollow">available</a> method.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload