[Zope] DTML vs ZTP

Tino Wildenhain tino at wildenhain.de
Mon Dec 13 04:52:41 EST 2004


Hi,

On Mon, 2004-12-13 at 10:21 +0100, Jaroslav Lukesh wrote:
> Dne úterý, 7. prosince 2004 15:59 Andy Yates napsal(a):
> > So far I've never run in to anything I did in DTML that I could not do
> > in ZPT.  If I were you I'd learn just enough DTML to use ZSQL methods
> > and concentrate on ZPT.  For me the biggest advantage of ZPT is keeping
> > the programming logic out of the html.
> 
> hmmm... As an example of keeping separation design from page logic could be 
> Plone? Do you try to redesign plone to your own absolutelly different 
> non-plonish design? Ha! It is very hard work, better to write whole templates 
> from the scratch. 

Well, this is because Plone is a very bad example of ZPT use.
Still you can abuse ZPT - while you can somewhat cleanly use
DTML - either case you need a sophisticated API to your application
and dont write code in the presentation layer. 
If you are so far, you see its a bit more convient to use ZPT
then to worry about where the h*** some variable got aquired.

<dtml-in linklist>
<a href="<dtml-var url>"> ... </a> 
</dtml-in>

(whats url? attribute? object? loop variable? request variable? Cookie?)

<a tal:repeat="link here/linklist" tal:attributes="href link/url"> ...
</a>

Well, for me, the latter looks more understandable.

Regards
Tino




More information about the Zope mailing list