Search code examples
plonediazo

switch diazo (plone.app.theming) themes based on cookie


I'd like to be able to enable administrators to change which theme is currently being used just for them. Possibly by setting a cookie, or special url. This will enable them to be able to debug a copy of their theme while another version is live for everyone else.


Solution

  • I've made something similar that uses the hostname to decide which diazo theme to use. There was no problems having a different rules.xml, index.html and custom resources. The themingplugins was another story (overrides, views, browserlayer etc), I don't know how good it is to register/unregister themingplugins on each request.

    I'll update this comment when I get home so you can see what I did. If I remember correctly I subclassed and replaced something registered from plone.app.theming (the component that applies the theme).