Reputation: 698
I don't found how to sort my documents & web contents by date in the Liferay back office. I suppose that i have to modify a special JSP in the hook...
i expect a default sorting. When the user goes to the documents and media, i expect that documents are sorted by default by date (without clicking on sort by button).
Any ideas ?
Upvotes: 0
Views: 926
Reputation: 931
You can hook this jsp for the web contents
/html/portlet/journal/view-entries.jsp
modifing this code
if (Validator.isNull(orderByCol)) {
orderByCol = portalPreferences.getValue(PortletKeys.JOURNAL, "order-by-col", "modified-date");
orderByType = portalPreferences.getValue(PortletKeys.JOURNAL, "order-by-type", "asc");
}
orderByComparator = JournalUtil.getArticleOrderByComparator(orderByCol, orderByType);
For the documents if you see the code of the jsp
/html/portlet/document_library/view-entries.jsp
modifing this code
if (Validator.isNull(orderByCol)) {
orderByCol = portalPreferences.getValue(PortletKeys.DOCUMENT_LIBRARY, "order-by-col", StringPool.BLANK);
orderByType = portalPreferences.getValue(PortletKeys.DOCUMENT_LIBRARY, "order-by-type", "asc");
}
in the both jsp just change the default value to your desired
Upvotes: 1