[Zope] DTML?

Christian Scholz cs@comlounge.net
Tue, 11 Jul 2000 00:10:51 +0200


Hi!

> Brian Lloyd wrote:
> <snip id is sometimes a method (not always though ;-)>
> > This is one of the things on my List Of Evil Things that
> > should be changed one day in Zope3K :)
> 
> <RANT type="angry,frustrated">
> 
> How about the nasty hacky mess that is DTML?
> 
> Some priceless artifacts that need to go:
> 
> <dtml-var "someMethod(_, _.None, myparam)">
> <dtml-call "REQUEST.set('keyname','value')">
> <dtml-let x="'hello out there'">
> <dtml-var "_[REQUEST['myDoc']]">What is this supposed to do?!
> <dtml-var "PARENTS[-1].folder.getitem(_.getitem('id',1))">

and maybe <dtml-var "REQUEST[_['sequence-item']]">

> Not to mention the horribleness that is <dtml-in> and <dtml-with>.
> 
> There's dtml-tree too, but hopefully I'm going to land very hard on that
> tomorrow and beat it into something like a decent shape ;-)
> 
> While I'm at it, how about some docs for the manage_* methods in the
> interfaces Wiki?
> 
> </RANT>
> 
> Okay, seriously, DTML is really hurting Zope's chances with a lot of
> people/companies. DTML should be easier than, say, creating a Form in
> Lotus Notes or writing a component in Mason. That requries, IMHO:
> 1. Clear definition of when it should be used.
> 2. A clean, concise syntax (like Python, DTML is more like Perl right
> now ;-)
> 3. Good documentation (much easier to do if 1 and 2 are met...)
> 
> I also think having Python Methods ship with Zope would really help...

Actually I also like it more to code stuff in Python. It's so much easier
than to figure out how to do it in DTML. 
Basically what I like in Zope is the environment you also have in Python
Products, like Acquisition. This is quite handy. That's why I try to do
most stuff in Python Products then in DTML. But actually this is not
one of the main things which were thought about a lot as it's still not
that easy to use Products as ZClasses (and be it only the managing of
Products.. You might want to have different locations for different
products etc. )

And another thing I don't like about DTML is the mixture between code
and layout. IMHO this is a bad thing. This is also the reason why I switched
from PHP to Python some time ago.. 
What I would think as more useful is to provide some custom tags by the
website developer which the website designer can then use. These should
be abstract and clear in meaning. The actual implementating of these
tags could then be done separately in maybe Python..
(we had this before.. maybe the XML stuff can help here).

The advantage would also be that you can provide quite powerful tags like
an easy handling of database forms, etc.  (I did this some time ago
with pure python.. developing with it is quite fast. One day and you
have your basic database frontend with some basic CMS stuff.)

But nevertheless for basic tasks a good template language is neccessary.
And I agree with Chris that things like the above mentioned make it not
that usable/readable.

> There are niggles (like the rediculous id problem) which you can live
> with, but doing anything other than the really mundane in DTML means
> extreme hair loss right now, which is not good.
> 
> I wonder how many other people would agree with me: nevermind ZEO, or
> the PTK, ZPatterns or any new fancy functionality. Can we at least have
> a decent template language that doesn't confuse the hell out of newbies
> and oldbies alike...

yep.

> PS: Zope: yes it makes the hard things very easy, but it makes the easy
> things very hard, so it all balances out nicely... ;-)

:)

-- christian