[Zope-CMF] Forcing skin change

Tres Seaver tseaver@palladion.com
Mon, 13 Aug 2001 10:59:46 -0400 (EDT)


On Tue, 7 Aug 2001, Parish, Yoav wrote:

> I am trying to create a portal that has three or four different
> skins but uses the same pages partially. At the entry page the
> user can decide on which portal he wants to enter.
> 
> How can I force a change of the skin for the user?
> <dtml-call REQUEST.set('portal_skin', 'other_skinname')> doesnt
> seem to work

Simplest would be to emulate what the preferences page does;
something like::

  context.REQUEST.set( 'portal_skin', 'other_skinname' )
  context.portal_skins.updateSkinCookie()
  context.REQUEST[ 'RESPONSE' ].redirect( context.portal_url()
                   + '?portal_status_message=Skin+changed.')

Tweaking cookies will often require a redirect, in order to allow
the skins tool to do its setup appropriately.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com