[Zope3-Users] Re: Confused about skinning in Zope3

Albertas Agejevas alga at pov.lt
Sun Sep 17 16:51:55 EDT 2006


On Sun, Sep 17, 2006 at 10:43:39PM +0200, Luis De la Parra wrote:
> Philippe Clérié wrote:
> > a) skins are applied globally and not locally to the packages that own
> > them;
> > 
> > b) skins are not *picked up* unless directly referenced in the URL.
> > 
> > Somehow that does not feel *natural*. Am I missing something?

No, both of these points are correct.

> I'm not sure wether this is the right way to do it, but you can set up the
> skin with a traverse-subscriber:
> 
> 
> def myAppTraverseSubscriber(event):
>     """A subscriber to BeforeTraverseEvent.
> 
>     Sets the "AC" skin if the object traversed is a "MyApp"
>     instance.
>     """
>     if (IMyApp.providedBy(event.object) and
>         IBrowserRequest.providedBy(event.request)):
>         applySkin(event.request, AC)

Yep, this is the canonical way to make skins apply to certain kinds of
objects automatically.

Albertas


More information about the Zope3-users mailing list