How to define a new skin in Zope 3
Tue, Oct 24, 2006,
100 Words
Lifted from zope.app.rotterdam
- Create a new browser skin layer
from zope.publisher.interfaces.browser import IBrowserRequest
from zope.publisher.interfaces.browser import IDefaultBrowserLayer
class rotterdam(IBrowserRequest):
"""Layer for registering Rotterdam-specific macros."""
class Rotterdam(rotterdam, IDefaultBrowserLayer):
"""The ``Rotterdam`` skin.
It is available via ``++skin++Rotterdam``.
"""
- Register the skin in configure.zcml
<interface
interface="zope.app.rotterdam.Rotterdam"
type="zope.publisher.interfaces.browser.IBrowserSkinType"
name="Rotterdam"
/>
Declaring a resource and a page for the skin
<browser:resource
name="zope3.css"
file="zope3.css"
layer="zope.app.rotterdam.rotterdam" />
<browser:page
for="*"
name="standard_macros"
permission="zope.View"
class=".standardmacros.StandardMacros"
layer="zope.app.rotterdam.rotterdam"
allowed_interface="zope.interface.common.mapping.IItemMapping"
/>