Plone 4.2 has just been released. Congrats to Release Manager Eric Steele and all of the excellent folks who worked hard to make it happen! For me, this is one of the most exciting Plone releases ever, because this is the first release of Plone that includes the amazing Diazo theming system as part of the Plone core.
Diazo completely revolutionizes the process of theming a Plone website, and it’s already making the lives of everyday Plone integrators better What’s more, while Diazo is now part of Plone, via the plone.app.theming module, it’s also a standalone website theming system that can be used the theme pretty much any website. So, not only is Diazo a revolution in Plone theming, I also think that it has the potential to revolutionize how any website is themed. (Diazo-powered Drupal or WordPress anyone? 😉 )
What is Diazo?
Diazo is a simpler and smart approach to theming a website–without sacrificing creative control. Here’s how it works: Your graphic designer, who doesn’t need to know anything about Plone, builds you a theme consisting of one or more HTML + CSS templates. Plone emits its HTML pages, known as the “content.” Diazo then lets you merge bits and pieces of Plone’s HTML content into your theme’s HTML and CSS template. Diazo’s merging behavior is governed by a simple text-based rules file consisting of simple directives such as <append>, <replace> and <drop>. It’s a drop-dead simple syntax that anyone can master, and it doesn’t require you to understand anything about how Plone works–basic HTML and CSS literacy is all you need.
I’m intrigued, tell me more.
Diazo does its magic by building on top of XSLT (eXtenstible Stylesheet Language Transformations), a standard originally developed in the late ’90s that defines a language for transforming XML documents into other XML documents. (HTML pages are one kind of XML document.) Raw XSLT is too generalized and too complex for everyday use as a everyday website theming technology, so Diazo provides a simple and user-friendly set of basic rules that get compiled into XSLT behind the scenes. If you’re already an XSLT wizard, you can use the full power of XSLT expressions in your Diazo rules files, but most folks will never need or want to do this.
Plone 4.2 comes pre-configured for Diazo (via plone.app.theming), so if you’re using Plone, you don’t have to lift a finger. If you are using Plone alongside other web applications, or not using Plone at all, most modern webservers already have support for XSLT transformations, so deploying Diazo via WSGI, Ngnix, Varnish or Apache is simple and straightforward.
Diazo’s been around for a while, and it’s been battle tested in production as an add-on product for several years now. It’s ready for prime-time. There are already a couple dozen Diazo-powered Plone themes available for download, and I’m expecting to see lots more as Diazo becomes “mainstream best practice.” It’s pretty easy to take any generic open-source HTML/CSS website theme and adapt it for Diazo.
Sounds great, what’s the catch?
So, if you need to make a Plone website look beautiful, Diazo is all you need. If you need to fundamentally change what content Plone is emitting in the first place, then you’ll need to dive into Plone customization. Diazo doesn’t completely replace all of the customization that you might to do Plone, but it narrows the scope of what you need to do inside of Plone quite a bit.
The future is even brighter
If you’ve got a vivid imagination, you might already be thinking, “OK, simple text-based rules files are cool, but what about a graphical editor for building themes?” Well, that’s in the pipeline. Martin Aspeli is putting the finishing touches on a version of plone.app.theming that includes a graphical editor for Diazo rules files. This is currently slated to ship with Plone 4.3, and will make it point-and-click easy to build or modify Diazo theme rules.
I’m really excited about Diazo. It’s the fulfillment of a vision for “rules-based theming” that’s been percolating in the Plone and Python communities for a number of years now, starting with Paul Everitt’s original implementation of Deliverance way back in 2008. It was a radical idea then, and it’s still cutting-edge now. Diazo brings rules based theming into the mainstream, both for Plone and for other web applications. I think we’re going to look back a few years from now and wonder why we ever themed websites any other way.