[Zope] Curious DTML question

Nick McDowell nmcdowell@quris.com
Wed, 17 Jan 2001 15:20:13 +1300


Hi,

I have a quick question regarding the "<dtml-with>" tag.

I call a dtml method (that formats content into a HTML template) called
myHTMLtemplate.  This method is in another folder, called templates, and
when I call it like -

<dtml-with templates>
<dtml-var myHTMLtemplate>
</dtml-with>

.......everything works correctly and my HTML page is rendered properly with
graphics etc.  However I initially tried to execute the method via the
following (slightly less keyboard action) -
<dtml-var expr="templates.myHTMLtemplate">

.......this results in the HTML template being displayed in plain text
format i.e. the HTML is not rendered and all the tags are visible.  I also
tried calling -
<dtml-var expr="templates.myHTMLtemplate()">
.......which was worse as it  resulted in errors relating to Zope's
inability to "locate" dtrml methods called within the "myHTMLtemplate"
method..
The documentation I have been reading suggest that the first two commands in
my example are equal, and thus should generate the same result, although in
my case this is clearly not so.  If anyone could please enlighten me on
what's occurring or what mistakes I'm making, if any, I would greatly
appreciate it.

Cheers
Nick