"I keep hearing about templates in SquirrelMail. What's the deal?"
SquirrelMail is in the process of developing a templating engine that will allow template developers to have almost total control over the look/feel of the SquirrelMail user interface. This process started in the 1.5 DEVEL branch and will be an ongoing work throughout this series (and probably more). For the sake of all involved, we have taken to referring to this process as t12n, short of templatization. Thanks to Paul for saving all of us many keystrokes.
SquirrelMail uses a pluggable template wrapper system that allows administrators to plug in their favorite templating engine. By default, SquirrelMail comes with both a PHP based engine and a Smarty based engine, but if someone wants to work with us to integrate another engine, please get in touch.
Templates in SquirrelMail will allow almost the entire user interface (UI) to be separated from the core SquirrelMail logic. Everything from Cascading Style Sheets, to buttons and images, to tables and table structure can be modified within the templates. Eventually, (almost?) all elements of the SquirrelMail UI will be controlled through templates.
Templating is a large undertaking, and the current thinking is that it will be accomplished in two stages:
- Separation of the UI and the core logic.
- Scrubbing of the UI and core logic to achieve a finer separation as well as a better interface for the template authors.
Currently, there is a lot of intermingling of UI and core logic. The first step of the templating process is to separate the UI and core logic as much as possible. For some pages, this can be accomplished quite easily; on others it is very difficult. This has resulted in some very rough separation in certain cases.
The second stage of templating is to come back and smooth out the bumps in the template road. Going through the templates and cleaning up the items that are difficult to code, making templates friendlier to potential authors, writing the templates documentation, i18n, adaptation with plugins, etc. will all occur in the second stage.
Here are some of the things that have already been implemented in the template engine:
- Template configuration files
- Additional Cascading Style Sheets
- Template inheritance: template set authors can base their template set on another one (such as the default_advanced set that comes with SquirrelMail) so they need not implement any pages they want to use from default_advanced.
- Icon theming within templates
See the CurrentTemplateStatus for a list of what has been templated and what still needs to be templated. There's also a page on WebServicesandWebServicesClients to be used with templates.