Old Templating Engine

ajt on 2006-01-27T18:58:51

What seems like aeons ago I wrote a simple templating engine in Perl. It's a bit crufty in places but it does it's job. At the moment for the first time, someone other than me is using it the way I intended, and it's given me fresh impetus to re-package it up as a module and put it on CPAN.

What I need to figure out is a neat form of plug-in technology, so that different HTTP clients and XML/HTML tool-kits can be seamlessly supported.


Re:

Aristotle on 2006-01-28T02:00:12

Expect to go unnoticed. The field is really, really crowded.

Re:

ajt on 2006-01-28T15:03:56

Indeed. I'm not actually interested in the templating side per se, rather developing a module that does automatic plug-ins.

I don't like most of the templating engine out there. Most of them are just fundamentally flawed in their design. They are not templating systems at all, they are formating engines. One "formatter" per page, but drawing on dynamic content - multiple possible versions of the same page. I want a single template for every page, but each page being static, only one version of the page.

We used TT2 for a project at work. It was very easy to use, but no way as easy as the fan boys would have you belive. You certianly couldn't give it to web monkeys - you need to know Perl to make any sense out of it at all. For that project it made sense, we had one formatter per page/stage and each page drew dynamic content from the SAP system. It's a totally stupid way of building a traditional content only web site, but it's great for sites where you are building a limited number of pages from an interartive source.

Re:

Aristotle on 2006-01-28T17:30:36

Yeah, I dislike almost all of them as well. I have a rant about that percolating in the back of my head; one day I’ll write it.

Re:

ajt on 2006-01-28T21:47:31

Somebody needs to deflate some egos...

Re:

jordan on 2006-01-29T03:18:55

Can someone tell me _wrong_ with Text::Template? I have to admit I've not used it, yet, but it seems like such a good idea.

I've used TT, but every time I do, I feel like I've abandoned Perl for something else...

Next time I want to do something that needs it, I'm trying Text::Template. Fortunately, it's the easiest to try, small, self-contained and easy-to-install.

Re:

Aristotle on 2006-01-29T03:47:02

Text::Template is decent.