[Zope] Using DTML methods to provide HTML

Phillip J. Eby pje@telecommunity.com
Sun, 11 Jul 1999 09:06:40 -0500


At 01:00 PM 7/11/99 +0200, Anders Qvist wrote:
>In a DTML document called "authors" I have this situation:
>
>  <!--#var "sixfield_page(title='Authors and their works',
>                          body=authors_body())"-->
>
>six_fieldpage is a DTML method which uses two parameters, title and body
>and returns an entire HTML page. authors_body is a DTML method in the same
>folder and looks like this:

Change your call to:

<!--#var "sixfield_page(_.None,_,title='Authors and their works',
                          body=authors_body())"-->

When you call a DTML method in an expression from DTML, you must pass
"_.None,_" as the first two parameters if you want the current namespace to
pass through.  Otherwise, sixfield_page will not have access to any
variables other than 'title' and 'body', period.

I believe there's some more detail on how this works in the DTML reference
manual.