Skip to main content
RashidJorvee
Level 4
Mar 29, 2017 8:39 AM UTC
Solved

Can we sort replies in forum component in desc order

Hi,

I am going through the community forum component. Default setting for replies on forum is; ascending order(old reply will be on top and new reply will get append at the bottom). Can change the appearance of these replies? instead of ascending order can we show replies in descending order? I mean latest reply get append at the top and most old reply appear on the bottom.Please suggest me how can i achieve this?

Thank You in advance!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
aagarwa-1
aagarwa-1Accepted solution
Mar 29, 2017 1:23 PM UTC

Hi Rashid,

You can overlay the list-item.hbs present at /libs/social/forum/components/hbs/topic/list-item.hbs .

In this you can update the friendly url present at 

<a href="{{friendlyUrl}}"><h3 class="scf-topic-title">{{subject}}</h3></a>

to 

<a href="{{friendlyUrl}}?sortby=added"><h3 class="scf-topic-title">{{subject}}</h3></a>

i.e. appending the sort fields in request params to friendlyUrl.

2 replies

aagarwa-1
aagarwa-1Accepted solution
Mar 29, 2017 1:23 PM UTC

Hi Rashid,

You can overlay the list-item.hbs present at /libs/social/forum/components/hbs/topic/list-item.hbs .

In this you can update the friendly url present at 

<a href="{{friendlyUrl}}"><h3 class="scf-topic-title">{{subject}}</h3></a>

to 

<a href="{{friendlyUrl}}?sortby=added"><h3 class="scf-topic-title">{{subject}}</h3></a>

i.e. appending the sort fields in request params to friendlyUrl.

Translate
aagarwa-1
Mar 29, 2017 1:32 PM UTC

That was kind of a hack, you should follow this documentation

https://docs.adobe.com/docs/en/aem/6-2/author/communities/comments.html

Translate