Templation Integration Capabilities
2005.10.16 23:32
One thing that's always bothered me about PHP applications is the need to all to have their own templating system. I understand the need, but it seems like the majority of sites I build usually involve several applications, libraries, and static pages which don't (and shouldn't) know anything about each other. The result is usually a quick port of the design into several places. Yechh!
Templation was designed not to interfere with existing web applications, but admittedly most of the testing was done with homegrown apps where the programmers had Templation on their mind at a subconscious level. This weekend I got the chance to integrate Templation with a commercial shopping cart system (litecommerce) which is partially encoded using ioncube. I was pleasantly surprised to find it working out of the box simply by adding the Templation driver to the top:
<?php include('Templation/driver.php'); ?>
The application's templates are still required for the application to work, but some clever rearrangement means that most of the design stays in templation's templates, leaving the application's templates tight and focused. Having the basic design in one place makes me more comfortable with site-wide CSS or HTML changes.
My next challenge is textpattern integration. I've never been fond of templates and css stored in a database. I'm hoping a clever hack or two will bust the code open and I can retain all of textpattern's functionality except the pages and styles tabs. Should be a good challenge.


