[ANN] HTMLTemplate 1.0.0

Walter Dörwald walter at livinglogic.de
Thu Jun 3 21:06:29 CEST 2004

John Machin wrote:

> [...]
> Oh, you want *practical* experience eh? ;)
> I would think the "theory" is that you've got designers/authors working 
> on templates, who don't know code. They know HTML, and know CSS, but 
> they do not program or know any code. You give these people templates to 
> work on.

XIST follows a different philosophy: All templates are pure XML (in
fact most of our templates consist of a root element only (something
like <newsPage/>)). The rest is done in pure Python code. The designer
develops the XML elements for the layout. This might be something
simple like:

class pageTitle(xsc.Element):
    def convert(self, converter):
       e = html.h1(self.content)
       return e.convert(converter)

These layout elements can then be used for a static mockup to be 
presented to the customer (i.e. <pageTitle>foobar</pagetitle>
in XML or layout.pageTitle("foobar") in Python). The developer
responsible for the dynamic part uses these layout elements with
XIST JSP elements to implement the business logic, e.g. by using
layout.pageTitle(jsp.expression("myObject.getTitle()")). It would
be possible to use any other templating system for implementing
the business logic, e.g. use PHP:

> [...]
> Another successful separation of logic from presentation... or so the 
> theory goes... ;)

XIST uses another version, just that both logic and presentation
are implemented in Python. ;)

You have to say goodbye to your HTML editor with this approach, but
this gives you better control over your HTML code anyway.

Our main designer had no previous programming experience and was using
Adobe GoLive before joining our company. Now he's programming all his
HTML templates in Python without any problems.

    Walter Dörwald

More information about the Python-list mailing list