[Zope] Dynamic sorting in <dtml-in>

Joel Burton jburton@scw.org
Tue, 6 Mar 2001 21:38:54 -0500 (EST)


On Tue, 6 Mar 2001, Joel Burton wrote:

> 
> I feel like this should be easy, but I'm scratching my head try to
> remember if I've seen an easy solution.
> 
> I'm doing a standard objectValues dtml-in:
> 
> <dtml-in objectValues>
>   <dtml-var xxxxx>
> </dtml-in>
> 
> But I want to sort it by the attribute that is passed in the URL.
> I looked at the DTML source of the Zope site (where they do this), but
> didn't see how their sort_on was being used.

Of course, there is an easy solution:

<dtml-in objectValues sort_expr="order_by">
...

where order_by returns a variable name.

I *thought* I had tried this earlier, and was stumped that it didn't work.
More sleep, less programming, hmm? :-)

-- 
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington