RE: sortTool in velocity template of asset publisher

Lisa Rossi, modified 5 Years ago. New Member Posts: 22 Join Date: 3/5/20 Recent Posts
Hi all, i wish sort my list of entries by publish date. this is my peace of codeemoticonforeach ($curEntry in $sortTool.sort($entries, "publishDate:desc"))
This work, but if i reduce the number of journal article visible in the page (in configuration), i lost the sort.  Can any help me?Thank you
thumbnail
Dominik Marks, modified 5 Years ago. Regular Member Posts: 149 Join Date: 8/29/12 Recent Posts
You can just configure the Asset Publisher to sort entries by publishDate. So you won't need extra code inside your template to sort the entries.
Lisa Rossi, modified 5 Years ago. New Member Posts: 22 Join Date: 3/5/20 Recent Posts
Hi Dominik,i had done it already but sorting by date seems not to work in liferay 6.2 ga1. For this i have add logic in my template. 
Can you help me?
thumbnail
Dominik Marks, modified 5 Years ago. Regular Member Posts: 149 Join Date: 8/29/12 Recent Posts
The $entries object only contains the assets which are visible. So if you reduce the number of assets it will only sort those.

I don't know if there is actually a bug about sorting by date in Asset Publisher. Liferay 6.2 GA1 is rather old. Maybe you should consider to update to at least the latest 6.2 GA7.