[Zope] Problem: Calling DTML Method from ZPT

Dieter Maurer dieter@handshake.de
Sat, 4 Aug 2001 03:21:15 +0200 (CEST)


Mike Murphy writes:
 > I am having problems executing a DTML Method from a ZPT.  I have been
 > unable to find documentation regarding whether this is even possible or not.
It is possible (we do it with great success).

 > Here are a couple of examples:
 > 
 > <!-- With this snippet, I get the DTML unrendered: -->
 > <p tal:replace="python:root.games.hangman.index_html"></p>
You forget to call the DTML object. Use:
   <p tal:replace="python:root.games.hangman.index_html(here,request)"></p>

 > <!-- With this snippet, I get a TALES error and a big stack trace: -->
 > <p tal:replace="root/games/hangman/index_html"></p>
This should work.

The "TALES" error (last PageTemplate release!) should tell you
(and maybe us) more about the problem cause.

 > Anybody have any ideas what it is that I am doing wrong?  I like ZPT
 > conceptually, and ran into this snag while converting some of my DTML.  (I
 > am running Zope 2.4.0 with the latest hotfix.)
You information is a bit scarce.


Dieter