cancel
Showing results for 
Search instead for 
Did you mean: 

FreeMarker sort and sort_by

lesteinb
Champ in-the-making
Champ in-the-making
Hi There,

I'm trying create lists that can be sorted by various document properties.

You can sort by "name" - this works:

<#list companyhome.childByNamePath["Users/Leroy
Steinbacher/photos"].children?sort_by("name") as child>
${child.properties.name} - ${child.properties.description}<br>
</#list>

But it doesn't like it if you try to sort by "description" or any other document property:

<#list companyhome.childByNamePath["Users/Leroy
Steinbacher/photos"].children?sort_by("properties.description") as child>
${child.properties.name} - ${child.properties.description}<br>
</#list>

Any suggestions?

Thanks,

Leroy
1 REPLY 1

simon
Champ in-the-making
Champ in-the-making
May be a little late but for futher references:
<#list theList?sort_by(["properties","description"]) as child>