[Zope-CMF] Question on Default Skins

Carl Rendell cer@sol43.com
Mon, 12 Aug 2002 12:44:41 -0700


Gr=E9goire,

I see that you are correct. The current cookbook recipe does not=20
work in the newly released CMF 1.3, Though it did work correctly in=20
CMF 1.3-beta2 - just tested that to verify the behavior.

Curious though, I'm going to do some digging to see what changed=20
between version and fix my posting.

Thanks for the catch,

~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
>
>