Updating Plone 3 themes for Plone 4
Plone 4's Built-in Themes
Plone 3 shipped with two skins, Plone Default and NuPlone.
Plone 4 includes three skins:
- Sunburst Theme
- A new, modern skin, packaged in the plonetheme.sunburst egg. Sunburst is the default skin for newly created sites.
- Plone Classic Theme
- The old default skin that was called Plone Default in Plone 3. It is now packaged in the plonetheme.classic egg.
- Plone Default (or "Unstyled")
- The "Plone Default" skin is now just a barebones interface with no CSS styling, intended for use with post-processing theming engines such as xdv or deliverance.
Plone 4 no longer ships with NuPlone, but it is still available as an add-on.
Upgrading a Plone 3 site with an existing theme
If you upgrade a site from an older version of Plone to Plone 4, the automatic upgrade will try to do something reasonable with the theme.
If you have installed and selected a custom theme, almost no changes will be made. The exception is that the 'plone_styles' skin layer will be replaced by the 'classic_styles' layer, since the name of this layer used by the Plone Classic Theme has been renamed. You may need to take additional steps to update the theme to work properly in Plone 4, as described below.
If your skin was set to "Plone Default" with the default set of skin layers, your skin will be set to "Plone Classic Theme," which should look the same.
If your skin was set to "Plone Default" but you have customized it by changing the skin layers used (or installing add-ons which add additional skin layers), then these skin selections will be copied to a new skin called "Old Plone 3 Custom Theme," which will be made active. The viewlet configuration will also be preserved.
Updating a theme to work in Plone 4
There are several updates you may need to make to a custom theme to make sure that it continues to work in Plone 4.
Updates to main_template.pt
If your theme has a custom version of main_template.pt, it will need to be updated. The best way to do this is probably to compare the custom main_template to the one that shipped with Plone 3, and then start over with a fresh copy of main_template from Plone 4 and re-apply the same modifications that had been made. In particular, watch for the following changes in main_template:
- The defines on the html tag have been modified.
- Some new defines have been added to the body tag.
- main_template now includes the standard viewlet managers used within the main content area, and defines a new slot called "content-core" where the actual content body goes.
Updates to template variables
Templates that have been overridden must be reviewed to make sure new changes to the original templates are included. Also, check to make sure they are not using global template variables that are no longer available.
Update the "based-on" declarations
If your theme is installed via a GenericSetup profile, then you probably have a profiles/default/skins.xml file which declares a "skin-path" consisting of various layers. The skin path declaration may say based-on="Plone Default". If so, update it to say based-on="Plone Classic Theme" so that it will continue to use the same set of layers as a basis that it did in Plone 3. If the "plone_styles" layer is referenced by name, change it to "classic_styles".
Similarly, you may have a profiles/default/viewlets.xml file which customizes the viewlets used in your theme. If any of the "order" or "hidden" manager directives in this file say based-on="Plone Default", update them to say based-on="Plone Classic Theme" instead.
Update the theme-specific interface
Your theme may define a Zope 3 interface called IThemeSpecific in browser/interfaces.py. If so, update it so that it extends the theme interface from the Plone Classic Theme:
from plonetheme.classic.browser.interfaces import IThemeSpecific as IClassicTheme
class IThemeSpecific(IClassicTheme):
"""theme-specific layer"""
This will ensure that your theme continues to have available the viewlets that are registered for the Plone Classic Theme only, as there are several which are slightly customized compared to the default viewlets of Plone 4 used by the Sunburst theme.

