[Zope-CMF] Question on Default Skins

Grégoire Weber gregoire.weber@switzerland.org
Mon, 12 Aug 2002 19:10:47 +0200


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 = (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 = 'hostName'
>req = context.REQUEST
>domain = split(req['SERVER_URL'],'//')[1]
>
>if find(domain,mainHost) >= 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égoire Weber
Rigistr. 31
CH-8006 Zürich
Switzerland
phone:  +41-(0)1-361 66 11
mobile: +41-(0)79-44 11 457
mailto:gregoire.weber@switzerland.org