[Zope] New to Zope

J. Cameron Cooper jccooper at jcameroncooper.com
Wed Nov 12 19:20:10 EST 2003


> Thanks for the links--the devshed site does a great job of going over 
> the basics.  DTML seems relatively straightforward to 
> me--ZPT/TAL/TALES/METAL seems kind of "wordy" to me, but since it's 
> "newer" I'm almost inclined to skip over DTML for now.

ZPT syntax does look more verbose than DTML, and that could be true -- 
though I'm not entirely convinced that's really the case. But even if 
you do have to do a bit more typing, ZPT will tend to save you lots more 
time on debugging and maintenance. It uses much less magic, has a more 
straightforward syntax, encourages you to keep code out of the template, 
and random other good things you will enventually hear about on the list 
or could find in the archives.

> Is there anything DTML can do that ZPT can't do?

I would wager they're both Turing-complete.

There may be domains where DTML is in fact easier to use: many people 
use DTML only for non-XML-ish rendering, like mail templates and such. 
And if you want to do something that relies on DTML namespace magic, 
it's obviously easier in DTML, though that can be emulated in ZPT.

> I drafted a quick site in DTML using DTML Documents for the header and 
> footer and included them via dtml-var and it worked just great.  I 
> tried doing the same with ZPT and using tal:replace with a header and 
> footer Page Template, and it converted the HTML to character entities 
> because I got back the plain HTML.  I'm sure it might be something 
> obvious that I've not read into yet...

ZPT would have you use macros for that, rather than do a straight 
translation of techniques from DTML. (It's not just the syntax that's 
different!) But your specific problem can be solved by using the 
'structured' keyword in the TAL statement.

             --jcc

-- 
"My point and period will be throughly wrought,
Or well or ill, as this day's battle's fought."





More information about the Zope mailing list