按日期对 Liferay 6.2 中的文档、媒体和 Web 内容进行排序
Sort Documents And Media & Web Content in Liferay 6.2 by date
我没有找到如何在 Liferay 后台按日期对我的文档和 Web 内容进行排序。我想我必须在钩子中修改一个特殊的 JSP...
我期待默认排序。当用户访问文档和媒体时,我希望文档默认按日期排序(无需单击按按钮排序)。
有什么想法吗?
您可以将此 jsp 挂接到网络内容
/html/portlet/journal/view-entries.jsp
修改此代码
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);
对于文档,如果您看到 jsp
的代码
/html/portlet/document_library/view-entries.jsp
修改此代码
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");
}
在两者中 jsp 只需将默认值更改为您想要的
我没有找到如何在 Liferay 后台按日期对我的文档和 Web 内容进行排序。我想我必须在钩子中修改一个特殊的 JSP...
我期待默认排序。当用户访问文档和媒体时,我希望文档默认按日期排序(无需单击按按钮排序)。
有什么想法吗?
您可以将此 jsp 挂接到网络内容
/html/portlet/journal/view-entries.jsp
修改此代码
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);
对于文档,如果您看到 jsp
的代码/html/portlet/document_library/view-entries.jsp
修改此代码
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");
}
在两者中 jsp 只需将默认值更改为您想要的