Approaches

« Return to page index

Plone Theme Reference

1. From Scratch or Based on Plone Default?

It is perfectly possible to build your own Plone theme completely from scratch, but you probably won't want to do this.

Based on Plone Default?

In particular, the bells and whistles of the Plone editing interface are wrapped up as part of the out-of-the box Plone Default, and you'll probably want to keep these.

The good news is that you can base your own theme on Plone Default and interweave your bits of templates, styles, scripts and components with what's already there. There are three ways of doing this:

  • with the Skin building block you customize the Plone Default bits (there's a neat way of doing this which ensures you leave the Plone Default theme completely intact)
  • with the Components building block you build your own, but you can reuse bits of the Plone Default components in the process
  • with the Configuration you simply add new directives

There's more good news - the elements of a Plone theme are broken up into very small parts. Each one can be dealt with independently of the others, so you can home in on just the bits you want to change.The price of all this flexibility is that it is sometimes difficult to track down exactly which bit you want, and things can start to seem complicated. This manual should help with that.

You can change a great deal of the look and feel just by overwriting existing CSS styles, or by rewriting some of the existing style sheets. However, if you want to start moving page elements around or rewriting some of the XHTML, then you'll need to delve into the templates, components, and configuration in more detail.

In the end, you're likely to come up with a theme based on Plone Default (that is, based structurally, not necessarily visually). This will probably contain

  • your own style sheet; or rewrites of some of the Plone CSS
  • some rearrangement of page elements
  • a few rewrites of some page elements
  • a few 'new' page elements

 

2. Through the Web or on the File System?

How to decide whether to build your theme through the web or on the file system.

Sooner or later with Plone you'll be faced with a decision. Plone is sufficiently flexible that there is often more that one way of doing things, and the conundrum is, usually, not how to do it, but which way.

You can customize Plone Default through the web very easily - particularly the skin and the configuration building blocks; further sections of this manual will point you in the direction of the relevant places in the Zope Management Interface to do this. However, if you want to move these customizations to a new site, undertake quite extensive customizations, or build a completely new theme, then it is advisable to move your work to the file system.

In this case you will need to create an installable module (also known as a theme product or  egg). This can be a daunting prospect, but there are tools available to simplify this process, providing you with a ready-made package into which to drop all the elements of your theme building blocks. We explain these tools on the next few pages.

If you are just starting out, then it is a good idea to get familiar with the building blocks and techniques by working through the web. It isn't difficult to move what you've done to the file system later. Once you start rewiring or moving components around you'll find the file system a more convenient way to work.

Through the Web

Pros Cons
Quick and easy Difficult to replicate or move from one site to another
Results immediately visible Large customizations can get complicated

Some customizations of components aren't possible (e.g. can't move viewlets between viewlet managers)

On the File System

Pros Cons
Portable and reusable Steeper learning curve when you first start out
Complete flexibility, can write your own viewlets and portlets Need access to the file system
Bundles your changes up into your own theme / skin Will sometimes need to restart to see changes

3. Future Directions

This reference manual outlines the current approach to Plone themes. But you may as well know now that there are other, perhaps simpler, approaches on the horizon.

Plone theming is getting a bit complicated. So the Plone community, in its inimitable and energetic way, is already exploring different solutions to the “theme problem”.

Things move fast. At the time of writing, some of the solutions listed below are probably not mature enough to use in earnest, particularly if you are just starting out. However, you might want to investigate them to see how they’re progressing:

Out of the Box Themes

A sprint and ongoing project to generate themes that will ship with out-of-the box Plone, and to brainstorm on other ways to improve the Plone theming story

Deliverance

Deliverance is a lightweight program that applies a theme to content according to a set of rules.