Is it possible to display like counts on the home topic list next to “Replies”?
Yes, just add:
/?order=op_likes
at the end of your URL.
Example:
Discourse Meta - The Official Support Forum for Discourse
does it mean we have to change the home page URL to this in our application set up?
Use this script, add it in admin/customize/css_html
in the </body>
tab
<script>
var TopicListComponent = require('discourse/components/topic-list').default;
TopicListComponent.reopen({
showLikes: true
});
</script>
It shows the column Like in your homepage between the columns Replies and Views.
Thanks Daniela! 2 questions though if you don’t mind:
- Will this perform any additional HTTP requests to the server? I’m on a high traffic server and need to be careful with adding more load.
- Can you also make this show only the op_likes?
No.
In that case you have to set showOpLikes: true
in above code instead of showLikes
.
Hmm, when I do that the likes column will be displayed, but not a single post displays a like. I did confirm that several of them have likes on the OP.
Then you have to use above solution from SidV. That will work perfectly.
Could anyone tell me how to modify the above code from @dax so it just shows Likes on one subforum?