[Zope] Mixing ZPT and DTML in CMF

Heimo Laukkanen huima@fountainpark.org
Sat, 20 Apr 2002 23:54:08 +0300


I know that ZPT and dtml-should not be mixed together, but I am moving 
old site from dtml to ZPT in CMF and wanted to test around, a couple 
of things.

I stumbled into a strange behaviour when I wanted to use 
portal_url-tool in on of my dtml-piece that was later on included into 
a ZPT-template.

In ZPT I include the file in the following way:

<span tal:replace="structure container/navbar">Navigation bar</span>

navbar is a DTML-method, in which I state:

<dtml-let osoite1="portal_url" path="_.str(osoite1)+'/'" >

Which makes no sense, since osoite1 will be an istance or URLTool. 
Meaning when I view the DTML-method it will show something like 
<URLTool instance at 906d7a8>

But when that is included into the ZPT it will transform into the 
absolute url. Great.

First I tried to use in dtml portal_url() which actually made it work 
in the DTML, but caused TALES-error in ZPT.


... Now my question is, that can anyone share any wisdow from where 
this behaviour comes from? I will be moving from the DTML later on, 
but for now it would be nice to know.

-huima