Making a Skin Switch Last
Because Plone determines the current skin on every page load, we need to make sure that any changes we make last.
Two of the above interventions are standard ways of changing underlying settings, ensuring that the skin switch lasts:
- (2B.i) Use the ZMI to enable changing users' skin preferences. Then use the Plone personal preferences page to change a user's preferred skin, and thus automatically create a cookie with the skin name.
- (3) Use the ZMI to change the default skin.
Two of the interventions involve changing underlying settings, but not in a standard way.
- (2B.ii) Set a user's preferred skin outside of the preferences form, and update the cookie.
- (2B.iii) Create a portal_skins cookie manually.
To do this, you should create a one-time script.
Finally, three of the interventions only make short-term changes that only last for the short lifetime of a single REQUEST:
- (1A) Call object.changeSkin('mySkin').
- (1B) Manually modify the SKINDATA variable.
- (2B) Add 'portal_skin' to the REQUEST as a simple string attribute.
To make these changes sustainable, you must use a script that repeats on every page load. The typical way of doing this is using an Access Rule. See EnSimpleStaging Tutorial - Switching Skins By URL and Using Zope/Apache to Switch Skins By URL for examples of how to do this.