[Zope] dtml-with problems
Jeffrey Shell
Jeffrey@digicool.com
Wed, 15 Sep 1999 16:11:17 -0400
> Hi all,
>
> I have a DTML Document that calls a DTML Method:
>
> <dtml-var standard_html_header>
> <dtml-var expr="renderReportType(renderType='edit',
> renderID=reportTypeIDSearch)">
> <dtml-var standard_html_footer>
Try:
<dtml-var expr="renderReportType(_,_.None,renderType='edit',
renderID=reportTypeIDSearch)">
The first two arguments (_,_.None) pass in the namespace (aka, '_') and
an entity known as the client (here as _.None). The _.None stems from
very very old behaviour of the underpinnings of DTML Methods.
There are some How-To's on the Zope site that talk about the Namespace,
which is a critical feature of DTML. Without passing in the _ and
_.None, the DTML Method that you're calling loses the namespace of the
DTML Method/Document calling it.
Another alternative would be to do:
<dtml-with expr="_.namespace(renderType='edit',
renderID=reportTypeIDSearch)">
<dtml-var renderReportType>
</dtml-with>
(you could also use the dtml-let tag here). The dtml-with tag pushes a
new level onto the namespace and places values in it, and then renders
the 'renderReportType' DTML inside of that namespace, and then pops the
new level of namespace off.
ERgh. I think. :)