Book Image

Plone 3 Theming

Book Image

Plone 3 Theming

Overview of this book

Themes are among the most powerful features that can be used to customize a web site, especially in Plone. Using custom themes can help you brand your site for a particular corporate image; it ensures standards compliance and creates easily navigable layouts. But most Plone users still continue to use default themes as developing and deploying themes that are flexible and easily maintainable is not always straightforward. This book teaches best practices of Plone theme development, focusing on Plone 3. It provides you with all the information useful for creating a robust and flexible Plone theme. It also provides a sneak peek into the future of Plone's theming system. In this book you will learn how to create flexible, powerful, and professional Plone themes. It is a step-by-step tutorial on how to work with Plone themes. It also provides a more holistic look at how a real-world theme is constructed. We look at the tools required for theming a web site. The book covers major topics such as configuring the development environment, creating a basic theme product, add-on tools and skinning tricks, integrating multimedia with Plone, and configuring your site's look and feel through the Zope Management Interface (ZMI). Finally, the book takes a close look at the thrilling and greatly simplified future of theming Plone sites.
Table of Contents (20 chapters)
Plone 3 Theming
Credits
About the Author
About the Reviewers
Preface

The evolution of skinning for Plone


Plone has always offered a robust base skin from which to start with solid CSS hooks, and it also has cleanly separated the CSS files that make skinning a fairly straightforward process. The actual process of working with the skin and CSS is what has changed dramatically over time and become more complex.

As of Plone 2.0, skinning was most commonly done through the web via the ZMI or Zope Management Interface. Working TTW via the ZMI resulted in a mixture of content and code that could not be easily pulled out of the ZMI. While tools exist that helped extract skin-related elements from the ZMI, it was still difficult to back up sites or to preserve the configuration in the event that a site needed to be moved to another Zope instance.

When Plone 2.1 was released, a tool known as DIY Plone Style was introduced that allowed users to quickly create a skeleton product so that users could work more easily on the filesystem. Additionally, a system known as GenericSetup was gaining momentum as a means of exporting settings to a skin product. TTW management was still possible, though pressure was mounting to move away from working through the ZMI.

Very little changed for themers in the transition from Plone 2.1 to Plone 2.5. Generally speaking, themers only had to know where to find certain knobs and switches in the ZMI, modify Plone's default templates, understand the TAL templating language, and work with CSS to make changes to their sites. While modification of basic templates is still a legitimate approach for writing templates and business logic, there is an extra layer of templating involved now, known loosely as "viewlets" and "portlets", that themers need to know about. Filesystem development is now the present state of theming. While it may sound daunting to work on the filesystem, once you get started, it's actually quite liberating.

As of Plone 3, a system known as buildout was introduced as well, and new visual design and deployment schemes were revealed that enabled developers to create a repeatable, testable development environment that could be shared across teams. For themers, this meant learning how to manage a development environment without necessarily having the programmatic knowledge to do so. Thankfully, Plone's installers mostly take care of this now.

In addition, themers not only had to understand the previously mentioned technologies, but they also had to learn about Zope, including such programmatic jargon as "multi-adapters", "browser layers", "boilerplate", "ZCML", and "GenericSetup profiles". Worse, they needed to learn how to work with Python classes and understand the difference between Zope 2 and Zope 3 templates and how to use them in their skin products. The complexity involved in skinning a site doubled, if not tripled, and the theme development time increased.

The positive side of this was a dramatic increase in the robustness, reusability, and flexibility of theme components. Once learned, the Plone theming framework provides tremendous leverage for web-design professionals. And, much of the Plone theme framework is unit testable, which is amazing! While there is a lot to know, it's worth stating that theming for Plone is a challenging but exhilarating experience. Even better, it has encouraged the Plone community to spend some real time focusing on the theming needs of the Plone users, meaning that the road forward will be easier to tread.

It's also important to mention that community resources are available if you have questions or problems. In particular, themers should be aware of:

You should always feel that no question is too stupid to ask, and someday you might even be able to answer someone else's questions. It's how most of us have arrived in the community, and we're always happy to have more contributors.

In the meantime, this book attempts to break down the barriers to Plone 3 theming in a way that makes it easier for non-programmers to successfully change the look and feel of their sites. While themers who are accustomed to working with systems such as WordPress and Drupal may find the learning curve challenging, with some effort, it is still possible to generate attractive and robust themes. I hope you enjoy the ride.