[Zope] Abstract rendering made difficult?
Brian Lloyd
Brian@digicool.com
Wed, 29 Mar 2000 11:34:18 -0500
> >> <dtml-call "REQUEST.set('foo', 'index_html')">
> >> <dtml-var foo>
>
> > <dtml-call "REQUEST.set('foo',index_html)">
> > <dtml-var foo>
> >
> > looks like it works
>
> In my case, 'foo' must be a string, and is actually passed in via
> a POST (I need it to maintain state in a "wizard" style form).
I'm coming in late on this thread, so ignore me if this
has already been covered... :)
It sounds like what you want is something like the following:
# docname is the variable passed in via the POST whose
# value is the name of the document to render. We use
# _.getattr(this(), docname) to retrieve the needed
# document from the current object. Note that we use
# the "let" tag instead of REQUEST.set, which is
# increasingly considered evil :)
<dtml-let theDoc="_.getattr(this(), docname)">
<dtml-var theDoc>
</dtml-let>
Brian Lloyd brian@digicool.com
Software Engineer 540.371.6909
Digital Creations http://www.digicool.com