[Zope] Performing subrequests from DTML
Casey Duncan
cduncan@kaivo.com
Fri, 13 Apr 2001 08:00:54 -0600
Ben.Peter@t-online.de wrote:
>
> Hi all,
>
> is there a DTML way to perform a subrequest?
>
> Details: I fetch a set of search results from a ZCatalog. All are of a
> known ZClass. To display the list of results, I have defined a method
> show_shortlist within the ZClass, the output of which I want to display.
>
> So, I would need to issue something like
>
> <dtml-in my_results>
> <dtml-subrequest expr="absolute_url + '/show_shortlist'">
> </dtml-in>
>
> Is there something like that, or will I need to move the show_shortlist
> method to the root folder? (Tends to cluttering up).
>
> Any other approaches are very welcome, too.
>
> Thanks,
>
> Ben
>
Something along the lines of:
<dtml-in name="Catalog">
<dtml-with name="getObject">
<dtml-var name="ZClassMethod">
</dtml-with>
</dtml-in>
or
<dtml-in name="Catalog">
<dtml-var expr="getObject().ZClassMethod(_.None,_)">
</dtml-in>
Will call a method of an object returned as a ZCatalog result.
Substitute the name of your method for "ZClassMethod".
--
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>