[Zope] How to make a script return rendered dtml
Dieter Maurer
dieter@handshake.de
Thu, 14 Jun 2001 22:45:36 +0200 (CEST)
Hi Tim,
Tim Hicks writes:
> ...
> Based on the
> presence of a query string, I want to either return the document_src
> (although with a few modifications), or simply return the rendered
> instance
> ...
> if context.REQUEST.QUERY_STRING == 'editor':
> print context.raw
> else:
> print context
>
> return printed
> ------------
>
> The 'else' statement simply gives me things like,
>
> <dtml-var standard_html_header>
... an FAQ. I answered similar questions at least 20 times....
Rendering a DTML object means calling it.
If the DTML object needs access to other Zope objects,
you must pass the namespace or a client in.
Client and namespace are the first two positional
arguments of the "__call__" method.
More information:
URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html
Dieter