[Zope] html templates?

Christian Scholz cs@comlounge.net
Tue, 20 Jun 2000 00:58:43 +0200


Hi!

> > Imagine writing simple html templates with some custom tags which are
> quite
> > abstract like <addresslist>. Then write some Python Product (or there
> might
> > be one Product to make this happen a little simpler) which implements
> these
> > tags.
> 
> Is there an advantage to this over:
> <dtml-var addresslist>
> (other than saving a few characters typing dtml-var)?

IMHO it's easier to read and to type and thus more understandable.
I used both ways now and I actually prefer the way without a prefix.

Some non-technical person might also have problems understanding the
meaning.. Also it's not that easy to pass parameters as with tags, e.g.

<addresslist tmpl="users" sort=alphabetic>

You then need to write the addresslist in some more complicated
form (using "" and the stuff). So IMHO it's cleaner with tags.
Also the dtml-stuff leads again to using programming inside
normal documents. Actually I don't want this. Actually it's then
also a security issue. 

Thus an HTMLDocument or something like this might have the advantage
that you can only use predefined tags with predefined functions and
these functions are defined somewhere else. You can then easily decide
whom you might give the rights to change a function and whom you might
give the right to simply change the layout.

> addresslist could be a property or another DTML method...

It's more complicated then if you have more than one of these.
You would need a dtml method or better a python method for every
"tag" you use. This would clatter the directory and make things a
little harder to understand. Thus I actually want some python class
which implements the tags I need and everything is capsuled fine.
Also this class could be derived from some other classes which already
give you some functionality like the template stuff or maybe some
database<->form interaction (automatic filling of forms with record data
and the like).

-- christian