[Zope-CMF] Question on Default Skins

Carl Rendell cer@sol43.com
Mon, 12 Aug 2002 13:18:55 -0700


Ok,

Not sure if this is a bug or not?

Skinnable.py was altered slightly between the beta2 and normal=20
release (versions 1.4 vs 1.4.4.2) in particular the=20
'setupCurrentSkin' method.

In the change I noticed that the the line setting=20
self._v_skindata =3D None was moved from before the if test for=20
self._v_skindata to after. Moving it back to allows the recipe to=20
work, but I'm not sure that was intended because it renders the if=20
test moot because the _v_skindata attribute is already set to None.

Using the 2nd recipe essentially goes around the setupCurrentSkin=20
method, but I'm not sure that's what is intended as the methods=20
tombstone indicates that setupCurrentSkin is designed for that=20
purpose.

So.. Is this a bug or by design?

~C

On Monday, August 12, 2002, at 10:10  AM, Gr=E9goire Weber wrote:

> Hi all!
>
> 1. I saw the receipe using 'setupCurrentSkin' last week and couldn't
>    get it working (http://www.zopelabs.com/cookbook/1028172355).
>
> 2. The previously posted receipe manipulating '_v_skindata' didn't =
work
>    either (http://www.zopelabs.com/cookbook/1016693454).
>
> For the receipe using '_v_skindata' I found a solution:
>
> CMF internals have changed and broken the receipes code. Prepend the
> REQUEST object to the list and it works (CMF 1.3)!
>
>   portal._v_skindata =3D (REQUEST, self.getSkinByName('Public'), {} )
>
> I placed a comment at the corresponding receipe.
>
> Greetings, Greg
>
>
> At 12:00 01.08.2002 -0400, you wrote:
>> Message: 7
>> Date: Wed, 31 Jul 2002 19:53:20 -0700
>> Subject: Re: [Zope-CMF] Question on Default Skins
>> Cc: Tim Hoffman <timhoffman@cams.wa.gov.au>,
>>        Gary Poster <garyposter@earthlink.net>,
>>        Chris Withers <chrisw@nipltd.com>
>> To: zope-cmf@zope.org
>> From: Carl Rendell <cer@sol43.com>
>>
>> Thanks to Tim Hoffman.. I've been able to get an implementation
>> which serves my purpose and objectives.
>>
>> Objectives:
>>
>> 'Toggle' skins based on domain name using basic Zope and CMF
>> supplied methods, but without resorting to the use of cookies -
>> which are not as reliable as i would like.
>>
>> Solution:
>>
>> Simple python script set up as a 'Site Access Rule' within the
>> target CMF Site -
>>
>> from string import find, split
>>
>> mainHost =3D 'hostName'
>> req =3D context.REQUEST
>> domain =3D split(req['SERVER_URL'],'//')[1]
>>
>> if find(domain,mainHost) >=3D 0:
>>   req.set('portal_skin','MainHostSkin')
>>   context.setupCurrentSkin(req)
>>
>> This works perfectly for me and the situations I'm currently
>> running into. Thanks again to Tim.
>>
>> ~C

Carl E. Rendell
Solution43
Information Distribution Consulting        |   "Ahhhh the power of
cer@sol43.com                              |    acquisition"  - Chef Z
>
> _____________________________________
> Gr=E9goire Weber
> Rigistr. 31
> CH-8006 Z=FCrich
> Switzerland
> phone:  +41-(0)1-361 66 11
> mobile: +41-(0)79-44 11 457
> mailto:gregoire.weber@switzerland.org
>
>