Message Boards
Liferay 7.0.2 GA3 - page comments portlet, change order
Dev Liferay, modified 4 Years ago.
Liferay 7.0.2 GA3 - page comments portlet, change order
New Member Posts: 6 Join Date: 6/24/19 Recent Posts
Hi Liferay community,
I would like to change portlet page comments (ui discussion) to display comments by create date and number of likes. How to customize it? I tried to find fragment of code in /discussion/page.jsp but without positive result. Thank you for help in advance.
Regards,
K
I would like to change portlet page comments (ui discussion) to display comments by create date and number of likes. How to customize it? I tried to find fragment of code in /discussion/page.jsp but without positive result. Thank you for help in advance.
Regards,
K
Mohammed Yasin, modified 4 Years ago.
RE: Liferay 7.0.2 GA3 - page comments portlet, change order
Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts
Hi,
You have to override jsp "/discussion/page.jsp" refer below
https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/jsp-overrides-using-custom-jsp-bag
You can customise this fragment of code and put your condition in the loop as per your requirement.
DiscussionCommentIterator discussionCommentIterator = rootDiscussionComment.getThreadDiscussionCommentIterator();
while (discussionCommentIterator.hasNext()) {
...}
You have to override jsp "/discussion/page.jsp" refer below
https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/jsp-overrides-using-custom-jsp-bag
You can customise this fragment of code and put your condition in the loop as per your requirement.
DiscussionCommentIterator discussionCommentIterator = rootDiscussionComment.getThreadDiscussionCommentIterator();
while (discussionCommentIterator.hasNext()) {
...}