[Zope3-dev] Use skin from ZMI
Florian Lindner
mailinglists at xgm.de
Thu Oct 14 06:47:54 EDT 2004
Albertas Agejevas schrieb:
>On Thu, Oct 14, 2004 at 01:06:15PM +0400, Florian Lindner wrote:
>
>
>>One more question: Is is possbile to set a default skin?
>>So I don't have to say:
>>http://localhost:8080/++skin++centershock/objname/ each time but just
>>http://localhost:8080/objname/?
>>
>>
>
>If you want to use the skin just for a certain type of content
>objects, subscribe to the BeforeTraverse event:
>
> from zope.app.publisher.browser import applySkin
>
> def myTraverseSubscriber(event):
> """A subscriber to BeforeTraverseEvent
>
> Sets the MySkin skin if the object traversed is MyContent.
> """
> if IMyContent.providedBy(event.object):
> applySkin(event.request, MySkin)
>
>
> <subscriber
> factory=".skin.myTraverseSubscriber"
> for="zope.app.publication.interfaces.IBeforeTraverseEvent"
> />
>
>If you want to set a default skin for the whole Zope 3 instance, just
>use the browser:defaultSkin directive in overrides.zcml.
>
I just want to set it for certain modules. So I want my CSEvent objekt
in CS.Event always use the centershock style but leave the rest of Zope
instance uneffected. Isn't there a easier way to do that then with event
subscribers?
Thx,
Florian
More information about the Zope3-dev
mailing list