Performing subrequests from DTML
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 -- Ben Peter - Feldstrasse 8 - 35091 Coelbe Ben.Peter@t-online.de ph: (+49) 6421 983520
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 `------------------>
Ben.Peter@t-online.de wrote:
So, I would need to issue something like
<dtml-in my_results> <dtml-subrequest expr="absolute_url + '/show_shortlist'"> </dtml-in>
<dtml-var show_shortlist> should do it :-) cheers, Chris
So, I would need to issue something like
<dtml-in my_results> <dtml-subrequest expr="absolute_url + '/show_shortlist'"> </dtml-in>
<dtml-var show_shortlist> should do it :-)
That's precisely *why* we are here using Zope ;-) Philippe
participants (4)
-
Ben.Peter@t-online.de -
Casey Duncan -
Chris Withers -
Philippe Jadin