Personal tools
You are here: Home Documentation Tutorials Switching Skins How Does Plone Choose a Skin?
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

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.

George Lee

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).
Page 2 of 8.

The current skin is determined every time you open a Zope or Plone web page on an object -- whether a page through the Zope Management Interface (ZMI) or in your Plone web site. Each time you do so, there are several key variables in play:

  • portal_skins, the skins tool.
  • object, the object you are accessing.
  • REQUEST, the HTTP request that is processed as you access the object and which expires when the page is rendered.
  • REQUEST.portal_skin. If this property exists on the REQUEST object, it says which skin to use. It is typically a cookie which is created when a user logs in, or when a user changes her/his preferences.
  • member.portal_skin. The standard way of creating a REQUEST.portal_skin cookie is by calling portal_skins.updateSkinCookie(). Provided that the current member has a 'portal_skin' property, this method creates a cookie portal_skin with a value equal to member.portal_skin.
  • SKINDATA, a variable tucked in the Python code of Products.CMFCore.Skinnable. During the life of a REQUEST, it stores information about what skin to use. The standard way of changing SKINDATA is a call of the form object.changeSkin('mySkin').


In the final stages of determining the skin, Plone takes three steps:

  • Look if a skin name is encoded in SKINDATA. If so, use it.
  • Otherwise, look if a skin name is stored in REQUEST.portal_skin. If so, use it.
  • Otherwise, look up the default skin in the portal_skins tool.
 
by George Lee last modified October 22, 2006 - 05:53 All content is copyright Plone Foundation and the individual contributors.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by