[Zope] newbie-prob: dtml-in ... sort=myVar

Maik Jablonski maik.jablonski@uni-bielefeld.de
Thu, 15 Aug 2002 09:00:46 +0200


markus wrote:
> hi,
> a page is called via links like
> 
> 1.) myPage.html?sortkey=Date
> 2.) myPage.html?sortkey=Name
> 
> the value of sortkey is display properly with 
> <dtml-var sortkey>
> 
> i like to use the value of sortkey within the <dtml-in> -tag, like
> 
> <dtml-in expr="objectItems(['DTML Document'])" sort=_['sortkey']>
> 
> but that is not working...
> 
> the tags
> <dtml-in expr="objectItems(['DTML Document'])" sort=Date>
> <dtml-in expr="objectItems(['DTML Document'])" sort=Name>
> are doing fine, but that's not a solution for my prop.
> 
> please help
> 
> thanks in advance
> cheers, Markus

hi marcus,

have a look at the dtml-in-help-topic!

sort_expr=expression should do the job. Sorts the sequence by an 
attribute named by the value of the expression. This allows you to sort 
on different attributes.

use something like:

sort_expr="_['sortkey']"

cheers, maik
-- 
Maik Jablonski                 __o
www.zfl.uni-bielefeld.de     _ \<_    Deutsche Zope User Group
Bielefeld, Germany          (_)/(_)               www.dzug.org