Is it possible to display like counts on the home topic list next to “Replies”?
1 Like
Yes, just add:
/?order=op_likes
at the end of your URL.
Example:
Discourse Meta - The Official Support Forum for Discourse
3 Likes
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.
11 Likes
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
.
6 Likes
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.