We sort of use templates at work.
My group doesn't use something like Smarty or the lot, partly because we feel that PHP is a darn fine emulating language as it is and there's no need to bog things down if you don't need to. That aside, we do use libraries of functions in order to build out pages. One problem being that because we generally all work on something different, we've amassed a pretty large collection of these libraries that all share one notable feature. None of them work together.
To that end, we're trying to fix that little problem, but since we're all engineers, there's a certain protective pride folks have over their creation. Fair enough, i was like that once too. It's hard to pitch something after you put weeks into it.
Today, my group came to a near screaming match about this, mostly because we all agreed. One system of templates is supports a pretty large portion of the site, so naturally, they're getting the most attention. i spent several days doing something that should have been a quick kill, mostly because things were sort of scattered about.
Not that the design didn't make sense at the time, but there were a few assumptions made that weren't that sound because the folks building them made on small mistake. They thought that their templates were supposed to last forever. The functions were clever constructs that used well balanced, distributed code and optimally created HTML specific to a given section of the page.
Fact is, that's a really bad idea to have. Templates change, sometimes frequently. i've been working on this crap for over five years (twelve if you count the time i spent at my last job) and what i learned was that you're lucky if the bulk of your work lasts more than four months. Keeping it simple isn't just a good idea, it's the law.
i suggested (possibly stronger than i really should have) that it would be far wiser to create smaller, simpler template functions that took a block of data and did things like return a list, or return an image tag. Those would be used by templates that would contain lots of these calls with associated wrapper HTML. Reoccurring series of these sorts of things could be collected into "macros" but those would be just as temporary as the template that contained them. i suggested that because i built a system that supported seven different web sites off of it years ago, and i really didn't have to lift a finger whenever someone wanted to do a massive redesign.
Thing is that afterwards, there was a fair amount of yelling back, but it was all defensive. i tried to back down and let people make up their own mind (or at least wander to the same conclusion) and for the most part they did. It's just that i know i went about it completely wrong. So much for me being a tiny dictator. Taking the Stalin approach simply doesn't work.
i think i'll stick with the Guevara model for now.

