We’re trying to develop our Plone 4.1 product using only ZTK (Zope 3) views and hence haven’t defined a portal skin. I’m trying to override a view from a different package and in the past have used the layer attribute to do this.
plone.theme allows you to mark the request with a “layer” interface conditional on the currently selected skin. I’d like to mark requests with a “layer” interface if my product is installed, without creating a skin layer. How do I do that?
I have my interface defined already in zcml
<interface
interface=".interfaces.IThemeSpecific"
type="zope.publisher.interfaces.browser.IBrowserSkinType"
name="My Theme"
/>
and declared
from zope.interface import Interface
class IThemeSpecific(Interface):
"""Marker interface for skins part of 'My Theme'
"""
You have to use a browserlayer.
So, if you don’t need it for something else, you can remove the zcml interface declaration and keep only the python interface (maybe you can rename it something more specific like IMyPackageLayer). Then add a file browserlayer.xml in your generic setup profile with this:
After that you can use the layer attribute as always:
Just remember to restart zope and reinstall you product to apply the new genericsetup configuration.
That’s all.