[Zope3-Users] Skins with multiple layers using interface approach

andrew andrew at reurbanise.co.nz
Wed Aug 13 21:37:40 EDT 2008


Hi All,

I'm working on an application that uses the interface approach as per:

http://wiki.zope.org/zope3/SimplifySkinning

to define a skin and layer. So, for example, I have:

  <interface
      interface="vortex.layer.IVortexBrowserLayer"
      type="zope.publisher.interfaces.browser.IBrowserSkinType"
      />

  <interface
    interface="vortex.layer.IVortexBrowserSkin"
    type="zope.publisher.interfaces.browser.IBrowserSkinType"
    name="vortex"
   />

and:

from z3c.layer.pagelet import IPageletBrowserLayer
from z3c.form.interfaces import IFormLayer
from z3c.formui.interfaces import IDivFormLayer
from z3c.formui.interfaces import ITableFormLayer


class IVortexBrowserLayer(IFormLayer, IPageletBrowserLayer):
    pass

class IVortexBrowserSkin(ITableFormLayer, IVortexBrowserLayer):
    pass

However, I've now created a second skin for the application but I want
to have all the views, resources, etc., that have been registered
to IVortexBrowserLayer to be available to this new skin without having
to modify a lot of existing code. I can understand the old approach:

<skin name="blah" layers="layer1 layer2"/>

where you can acquire resources from a hierarchy of layers, but how do I
do this with the interface approach ?

Cheers, Andrew.



More information about the Zope3-users mailing list