[Zope3-Users] Re: Re: Confused about skinning in Zope3
Philippe Clérié
philippe at gcal.net
Sun Sep 17 19:31:23 EDT 2006
Thanks for both replies. I haven't gotten that far yet to understand and
apply the solution. But it's duly noted and I'll use it ASAP.
All the best
Philippe
Albertas Agejevas wrote:
> 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