Switching Skins

This Tutorial describes how Plone chooses a skin when you open a web page, and then describes the multiple ways that you can intervene to switch the skin. The Tutorial also discusses two common use cases, switching skins based on URL and the type of user (e.g., Anonymous or Authenticated).

  1. Overview An overview of the tutorial.
  2. How Does Plone Choose a Skin? A description of the variables and processes that Plone uses to choose a skin each time you visit a page.
  3. Intervening to Switch a Skin A summary of the main ways you can intervene in Plone's skin-choosing process, to switch a skin.
  4. Making a Skin Switch Last How to make a skin switch last beyond a single REQUEST and page view.
  5. Use Case One: Skin By URL References for switching a skin based on URL.
  6. Use Case Two: Skin By Type of User Example code for allowing certain users to switch skins.
  7. Synchronizing Skin Layers and CSS/Javascript Resources How to ensure that the proper CSS/Javascript resources are used in different skins.
  8. Additional Documentation on Switching Skins References for switching skins by URL.

All content on one page (useful for printing, presentation mode etc.)

 

Change based on login status

Posted by A C Reuben at Nov 13, 2006 08:06 PM
Thank you for this tutorial. I am working on plone site that would change skins automatically after user logs in, skin is selected based on user role. could you please guide me in a direction ,how to do that ?

How to add the external method?

Posted by Chris H. at Dec 18, 2006 07:00 AM
Thanks for the tutorial. This is exactly what I need. I'm running into a problem though when I'm trying to add the external method. The tutorial has verbose instructions for just about everything but appears to gloss over the particulars on the external method. I gave it a go but am running into problems (Plone 2.5.1).

"So we add it as an external method ext_switchSkin to the Plone site root"

So when I get into the ZMI and "add" the external method at the Plone site root, I get four fields to fill out. I put the following in:

ID: ext_switchSkin
Title: switchSkin
Module Name: switchSkin
Function Name: ext_switchSkin

I based it a little off of this link on how to add external methods:
http://plone.org/[…]/create-and-use-an-external-method

I seem to be stuck here. What am I doing wrong?

Any help would be appreciated. :)

swich skin on url best solution

Posted by Christof Haemmerle at Dec 29, 2006 09:13 PM
hi there,
usualy i use the access roule to switch a skin for a different url. since i am concerned about performance i really feel bad in haveing a if statement on every request to my zope server. is there a better solution for that? for example:
- can i run a second zeo client and configure the skin in the zope config of that zeo client?
- can i include a setting in the squid redirect which accesses the plonesite with my custom skin? i saw something like this available for zop3 (.../++skin++MySkinName/..) ?

Switch URL to Change Skin?

Posted by Harlow Pinson at Nov 29, 2007 06:17 PM
Frankly, switching URL to change skin is not user friendly in the least. Isn't there another way?