[SOLVED] Error when sorting folders

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2010 06:22 AM
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
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
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
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2010 09:25 AM
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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2010 11:16 AM
Found an issue:And add doclist.get.json.ftl in shared\classes\alfresco\extension\templates\webscripts\org\alfresco\slingshot\documentlibrary.<#list doclist.items?sort_by(['node','name']) as item>
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

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2010 03:55 AM
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
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
