[Zope] Variable substitution of <dtml-in> Attributes

Oliver Bleutgen myzope@gmx.net
Wed, 07 Nov 2001 23:16:37 +0100


Adam Warner wrote:

> Hi all,
> 
> This doesn't appear to be possible but I'm just confirming. I have this
> line of code:
> 
> <dtml-in expr="PARENTS[0].objectValues('Folder')" sort=id>
> 
> I'd like to be able to substitute the Attributes as a string. For
> example a dtml method called sort_order may contain the string:
> 
> reverse sort=id
> 
> Then I would substitute that in at runtime. It might look something like
> this:
> 
> <dtml-in expr="PARENTS[0].objectValues('Folder')" &dtml-sort_order;>
> 
> However this and similar attempts gives me a Document Template Parse
> Error.


It's possible, IIRC you have to use sort_expr instead of sort. See
the source-code of the ZMI, it's used there (for dynamic sorting
of the folder contents)

cheers,
oliver