cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] Error when sorting folders

laurent1050
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to sort the folders in Share alphabetically.

I've overrided alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.json.ftl


"items":
   [
      <#list doclist.items?sort_by("cm:name") as item>
      {
         <@itemLib.itemJSON item=item />
      }<#if item_has_next>,</#if>
      </#list>
   ]

But I've an error message saying
08210042 Wrapped Exception (with status template): 08210210 Error during processing of the template '?sort_by(…) failed: The "cm:name" subvariable was not found.'. Please contact your system administrator.

What is the correct parameter for the sort_by ?

Thanks
Laurent
3 REPLIES 3

laurent1050
Champ in-the-making
Champ in-the-making
Found an issue:
<#list doclist.items?sort_by(['node','name']) as item>
And add doclist.get.json.ftl in shared\classes\alfresco\extension\templates\webscripts\org\alfresco\slingshot\documentlibrary.

sebastian1
Champ on-the-rise
Champ on-the-rise
Found an issue:
<#list doclist.items?sort_by(['node','name']) as item>
And add doclist.get.json.ftl in shared\classes\alfresco\extension\templates\webscripts\org\alfresco\slingshot\documentlibrary.


Thanks Laurent,

was looking for something like that.
I tried ist at my test environment.

On thing I didnt like:

The Patch is for all items in the document lib..
So Folders and normal documents get mixed up aplabetically.

Is there a way to group folders and Documents to keep them seperated?

Regards

laurent1050
Champ in-the-making
Champ in-the-making
Hi sebastian1,

In my Alfresco I only have folders OR documents in a folder, so I've never a mix of folders and docs.

No ideas how to group separately folders and groups…
Maybe it's possible to had a sort of "group by" in the freemarker template???

Laurent