Choosing the appropriate theming approach
At the moment, there are several ways to theme a Plone site. What are your options, and which is appropriate for a given case?
Comparison of the available approaches
Product package
Pros:
- The ultimate in flexibility and control
- More flexibility when it comes to theming select parts of a site or sub-sites
Cons:
- More complex, requires a passing familiarity wtih ZCML and Python
- Less upgrade-resistant, since templates change
- Shipping your own templates will get you out of sync with the main product
collective.xdv
Pros:
- Can be compiled down to XSLT transforms that run as part of the web server process, so you don't need a separate proxy or WSGI setup. This also means a slight performance advantage over Deliverance.
- Easy to bootstrap with Plone.
Cons:
- Uses XPath selectors instead of the more familiar CSS selectors (not as big a deal as you may fear, since we can use a plug-in called Firebug to make it create the XPath expressions for us, as we'll see later).
Deliverance
Pros compared to xdv:
- Standalone, can be used without Plone to theme other sites and systems, has a good WSGI story.
- Supports a more familiar CSS syntax in addition to XPath.
Cons compared to xdv:
- Less integrated with Plone, requires you to understand more of the ecosystem and setup.
- Uses its own non-standard (but CSS-like) syntax, can't be deployed inside a web server process.
Which one should I use?
A general rule-of-thumb to help you decide what approach to choose:
- Use the add-on/product approach when…
- You need extreme granularity of control, and are willing to learn some Python and ZCML to get what you want.
- Use xdv when…
- You'd like to keep the theme separate from the code, and want a reusable theme approach that can potentially be deployed as part of the web server process. You don't want to worry about most of the "plumbing", and are comfortable using best practices from the Plone community.
- Use Deliverance when…
- You have advanced theming needs, including the ability to apply the same theme to multiple frameworks/web apps in addition to Plone, and are willing to set up a proxy or WSGI pipeline to make it happen.
Of course, reality is always a bit more complicated — you can apply an xdv-based theme to non-Plone setups too, if you know what you're doing.
The important part to know is that you can move between xdv and Deliverance pretty easily, so starting out with collective.xdv is likely to be a great start, even if you end up using Deliverance later.

Author: