Hello ! How the default sort can be changed ? I'm trying to show most liked posts at the top of thread and posts without any like - by date.
Can you help with advice how to get able of it ? Thank you !
Hello ! How the default sort can be changed ? I'm trying to show most liked posts at the top of thread and posts without any like - by date.
Can you help with advice how to get able of it ? Thank you !
There's no way to do that in the core, and to be honest it looks like a big change to implement if you want it to work at scale. :/ If you are determined its custom fork territory for Misago.
Maybe in v4 it would be achievable with custom plugin overriding threadview and thread posts resolvers, but that stuff is still far away :x
Sorry for a let down here.
Thinking this through its achievable with plugin system in current release, but it's still plenty of work. You will need to add custom indexes for posts table so queries are performant, and override views for thread view (and go to post views) to use custom sorting.
@rafalp thank you very much for your reply. The fact is that this sorting is the key in my situation( and misago is can be used as engine of the forum designed as the support function like stackoverflow. Can you please outline what changes are needed? Schematically, in what areas/files I need to make these changes. Just basic sorting by likes will make me happy, I mean without sort switching options and buttons for the users. Thank you so much !
I can provide an outline, but that's going to take a bit of work on my side, so I don't know yet when I'll be able to do it. But rough idea is to implement a plugin that defines custom URLs for thread view thread posts API and "go to post" views. Custom urls can point to custom views that just extend existing views but use custom "view models" - those are strategy objects that know how to fetch correct posts for given threads/pages. Those custom view models should do sorting by likes first and post id second.