[Zope] interpreting DTML

Dieter Maurer dieter@handshake.de
Fri, 9 Aug 2002 22:49:56 +0200


Ryan Lea writes:
 > What i am trying to do is highlight particular words/phrases in a DTML Document.
 > 
 > What i need to do is read in src dtml from a document, modify it then output it onto the 
 > screen (interpreted)
It would first render and then highlight.

 > ...
 > The problem is now that i have the modified DTML src in a string, there seems to be no 
 > way to have it output the interpreted version of it. (HTML tags get rendered, just DTML 
 > tags don't get interpretd)
You need to make your modified string again into a DTML object.
There are some classes for this in the package "DocumentTemplate"
(you are in an ExternalMethod (I hope)). You might want to use
the class "HTML" (don't know, which module defines it, maybe "dt_string").
You need to be careful, these classes do not make security checks.

There is also a "RestrictedDTML" mixin class in "AccessControl.DTML"
which can be used to provide security checking for the above mentioned
classes.


However, it is much easier to first render and than highlight...


Dieter