How to define a new skin in Zope 3

Lifted from zope.app.rotterdam

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``.
"""
<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"
/>

Comments