Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install collective.themeswitcher

How to install collective.themeswitcher

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install collective.themeswitcher
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
1.0a2 Available View build log
Lastest release
version 1.0a2 on May 12th, 2013


This addon provide a browser view @@themeswitcher which apply on the root and let you override the theme which is used on all theme technologies of Plone.

This addon is intended for integrators.

Plone Theming stack


From CMF this is the most old piece.

This one is monkeypatched.


from Zope3, this is the modern way to create and override views and so "viewpagetemplatefile".

This one is already set by plone.theme on the portal_skins.


The last technology it happens after the rendering of the page to make xslt transform on the Plone rendered page.

This one is monkeypatched.


This addon has been designed to easily support new switcher. At the moment the only switcher that is implemented is the "mobile switcher" based on user agent from http://detectmobilebrowsers.com/ (python version).

Some ideas on switcher that could be easily done:

  • switch on domain
  • switch on protocol (http / https)
  • switch on role
  • switch on path
  • switch on device (mobile, tablet, desktop)
  • switch on a cookie value

How to use

You just have to configure in portal_registry which switcher you want to use and configure it.

To use a specific diazo theme you have to copy it's settings to switcher registry.

For example let say you want to use plonetheme.mobile only for a mobile you have to add a registry.xml with:

<record name="collective.themeswitcher.theme.mobile">
  <field type="plone.registry.field.ASCIILine">
      <title>Mobile theme</title>
<record name="collective.themeswitcher.switcher">
  <field type="plone.registry.field.TextLine">
      <title>Theme switcher</title>
      <description>The named switcher that will be used</description>
<record name="collective.themeswitcher.absolutePrefix" interface="plone.app.theming.interfaces.IThemeSettings" field="absolutePrefix">
  <field type="plone.registry.field.TextLine">
<record name="collective.themeswitcher.currentTheme" interface="plone.app.theming.interfaces.IThemeSettings" field="currentTheme">
  <field type="plone.registry.field.TextLine">
<record name="collective.themeswitcher.doctype" interface="plone.app.theming.interfaces.IThemeSettings" field="doctype">
  <field type="plone.registry.field.ASCIILine">
  <value>&lt;!DOCTYPE html&gt;</value>
<record name="collective.themeswitcher.enabled" interface="plone.app.theming.interfaces.IThemeSettings" field="enabled">
  <field type="plone.registry.field.Bool">
<record name="collective.themeswitcher.hostnameBlacklist" interface="plone.app.theming.interfaces.IThemeSettings" field="hostnameBlacklist">
  <field type="plone.registry.field.List">
    <value_type type="plone.registry.field.TextLine"/>
<record name="collective.themeswitcher.parameterExpressions" interface="plone.app.theming.interfaces.IThemeSettings" field="parameterExpressions">
  <field type="plone.registry.field.Dict">
    <key_type type="plone.registry.field.ASCIILine"/>
    <value_type type="plone.registry.field.ASCIILine"/>
    <element key="ajax_load">python: request.form.get('ajax_load')</element>
<record name="collective.themeswitcher.readNetwork" interface="plone.app.theming.interfaces.IThemeSettings" field="readNetwork">
  <field type="plone.registry.field.Bool">
<record name="collective.themeswitcher.rules" interface="plone.app.theming.interfaces.IThemeSettings" field="rules">
  <field type="plone.registry.field.TextLine">

How to install


This addon can be installed has any other addons. please follow official documentation




1.0a2 (2013-04-29)
  • Nothing changed yet.
1.0a1 (2013-04-20)
  • Package created using templer [JeanMichel aka toutpt]

Subscribe to package updates

Last updated May 12th, 2013

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.