[ZPT] Adding to namespace stack in ZPT
Evan Simpson
evan@4-am.com
Fri, 21 Jun 2002 09:39:00 -0500
Jay, Dylan wrote:
> This one is getting me fustrated. I want to call some DTMLMethods from a
> template perhaps with a database result in the context (ie at the top of the
> namespace stack). Although I can call DTML from ZPT I can't seem to place
> things in the namespace stack, ZPT just uses its own namespace. For instance
>
> <dtml-with "qryA()[0]">
> <dtml-call showRow>
> </dtml-with>
ZPTs deliberately have nothing like the DTML namespace, although they
can deal with it if you pass it explicitly. I presume that 'showRow' is
the ZPT, here?
> How do I replace that (without rewriting showRow?
There might be a really roundabout clever hack to do that, but is it
really a requirement? The following should do what you need, if you're
willing to touch showRow:
<dtml-with "qryA()[0]">
<dtml-call expr="showRow(ns=_)">
</dtml-with>
...and change showRow to use "options/ns/whatever" to access the
'whatever' value in the namespace.
Cheers,
Evan @ 4-am