cancel
Showing results for 
Search instead for 
Did you mean: 

Sort using metadata

creddy2001
Champ in-the-making
Champ in-the-making
Hi

I created a web form and rendering Freemarker template.  In my rendering template i have something like

<#assign docs = alf.parseXMLDocuments('tax_relief', '/content/tax relief/source')>
<#list docs as child>

How to sort the docs by its creation time. Because i need to get the data from most recently created xml file.

Please help me in resolving this issue.

Thanks
Chandra
1 REPLY 1

kbonnet
Champ in-the-making
Champ in-the-making
In freemarker sorting a <#list> works like:

<#list docs?sort_by(["properties", "cm:name"]) as child>

You might have to tell freemarker that the property you're sorting on is a date and you have to make sure that all the objects have this property.

Koen