Theme it yourself - David ConventΒΆ

Tags: plone, ploneconf2007

If you're going to customize Plone, do it on the file system. Develop on the file system as it is repeatable, versionable, distributable, testable. Also it provides a few extra possibilities you don't otherwise have. For a new theme product, please use paster with the ZopeSkel templates.

Most of the rest of the talk was a demonstration. Creating a buildout with paster. Adding a theme with paster. So I'll restrict my summary to some quick notes (and URLs).

For interactive development, use firebug to edit the css files in your browser and to immediately see the difference. Afterwards, copy it back to your actual stylesheet (portal_css needs to be in debug mode for this). Also handy: aardvark .

Normally, you don't need to modify plone's xhtml output. The id and class attributes are generally both enough and smart. And there aren't too many. So just leave it alone as you otherwise need to customize virtually everything.

Much customization of the main template can now be done by viewlets. You hardly ever have to touch the main_template anymore. You can modify or add viewlet managers and you can add or modify viewlets to viewlet managers. To see how the page is build up out of all those viewlets, add @@manage-viewlets to your URL.

Viewlets have two methods: render() for rendering it (html, text, whatever) and update() for setting parameters. If you want to register a new viewlet for a viewlet manager, you'll have to look in plone/app/viewlets/configure.zcml for the correct interface for which to register the viewlet.

Technorati tag:

 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):