Discourse Post Voting

:discourse2: Summary Discourse Post Voting allows the creation of topics with votable posts.
:open_book: Install Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately.

Features

To create a new topic with votable posts open the menu in the top left of the composer and select ‘Toggle Post Voting’:

With the topic in Post Voting mode, there’s a filter to sort answers by votes or by activity. Here’s an example of one in action:

Configuration

Site Settings

Once installed, the plugin is enabled by default and the available admin settings are:

Setting Site Description
post voting enabled Enable Post Voting Plugin
post voting undo vote action window Number of minutes users are allowed to undo votes in Post Voting topics (enter 0 for no limit)
post voting comment limit per post Number of comments allowed on each post
post voting enable likes on answers Enable like button on replies on Post Voting topics
min trust to flag posts voting comments Minimum trust level to flag a post voting comment

Category-specific Settings

There are two category settings available. Use the wrench on the category page and access settings to see these:

:discourse2: Hosted by us? This plugin is available on our Business and Enterprise plans Post Voting | Discourse - Civilized Discussion


Credits

This plugin is inspired by Pavilion’s fantastic work on the Question Answer Plugin. As always, thank you for your continued contributions to the Discourse project. :medal_sports: :slight_smile:

63 Likes
Thoughts on a plugin which turns discourse into stackoverflow
Question Answer Plugin
Plugin: Ask me anything or Q&A format (threaded replies)
Any forum using the Q&A plugin?
How to get answer's comments? (stackoverflow-like & tiny)
A reddit-ish theme for Discourse
Voting Up the Best Answer!
Multiple Choice Poll questions
A case for downvotes and different ordering of replies
Post Voting comments ignore the Discourse Translator plugin
Points based currency to reward quality
Looking for a plugin for upvote/down votes
Building a plugin to add Stack Exchange features
Grow my community
But I didn't click Answer, I clicked Edit
Showing replies "in-place" like Reddit, instead of show 'em at the bottom
Badge Query (SQL)
Topics vs Posts vs Replies
Topic Ratings Plugin
Topic Ratings Plugin
Reordering a topic by ‘most liked’ or threaded replies
Renaming Discourse Upvotes [Post Voting]
- 1 like feature
How to simplify the forum? (couple of needs listed)
What Will be Best theme for a site like ecommerce
Is there any plugin for downvoting questions and replies in Discourse
Feedback on Our Community
'I have same question' theme/plugin
Journal Plugin
Looking for a plugin for upvote/down votes
Some users get javascript errors when trying to load our Discourse
Creating an Analytical Hub using Categories, Approval Process and Upvoting
Ordering replies by most liked
Custom embedded replies
No indication on post voting "Votes" tab that whispers exist
Nested comments feature
Whispers disappear from the display but still are in the database
No indication on post voting "Votes" tab that whispers exist
Whispers cannot be seen in Post Voting enabled categories
Bundling more popular plugins with Discourse core
Sort answers by number of likes in topic
How to make our forum looks like Q&A community than a forum?
Photo Competition or Contest - Do We Have Anything?
Admin setting for activity default sort order for Discourse Post Voting plugin
What would be the best plug-in for Contest with public voting in two categories?
Looking for a way to set the post section
Integrating Discourse and Stackoverflow?
Integrating Discourse and Stackoverflow?
Question Answer Plugin
Discourse Topic Voting
How do I get users to reply to each other? This doesn't appear on my site
Need a developer to get over the last couple of humps to launch our community
Question Answer Plugin
How to mention in Discourse comments, or disable commenting?
Journal Plugin
Community Notes in Discourse to Combat Misinformation
An error occurred while restoring from a backup: discourse_functions.raise_discourse_voting_category_settings_readonly() does not exist
Topic/replies structure
Referencing types of review items created by plugins
Debate / deliberation plugin
Question Answer Plugin
Customize new topic button text
A reddit-ish theme for Discourse

I am a bit of a Q&A fanatic, so I’m excited to see this new post format available in Discourse and tickled by how
 familiar
 it seems! I have some questions about the functionality and how customizable it is. Much of this may be answered in the plugin package but I figure it might be helpful to have here, too


  1. Is there education built in for the plugin that teaches users about the feature, how/when to use it, etc? I love @discobot - maybe there’s a tutorial/onboarding module for Q&A?
  2. You say admins can set the default within a category to Q&A - if they do, are topics required to be Q&A or do they just default to it?
    • If it’s a default, is there an option to require it? Can Q&A be disabled by category, too?
  3. If a category is set to default to Q&A, is this something that’s apparent to users? I see that the post creation button will say it’s a Q&A but I can imagine a seasoned user’s first interaction with the newly-added feature might lead them to overlook the text without something drawing attention to the post type before it’s submitted.

Thanks for making this cool feature official!

3 Likes

Yes, OP needs an update, these are the current options in category settings

The user will see a different button in the composer. You can change the button text via text customization.

4 Likes

A post was split to a new topic: Are Post Voting votes/replies accessible via API?

Has anyone been able to limit the amount of votes per user per topic? In our case, we are running photocontests, and we would like to limit each user to 5 votes max per topic.

2 Likes

Ahoj,

in :arrow_upper_right: this post I was directed to post the issue here to give the feedback.


In the thread linked above in the OpenStreetMap forum, where this plugin is used in some categories, user interface shortcomings with this plugin are discussed.

In short there are:

This plugin forbids to post a reply to a reply. It is debateable if this should be enforced or to be configurable on a per-instance basis, but it it is enabled, the following occurs:

  • The user can select some text and quote. The user can enter a reply. Only at the very end, when the reply is to be sent, it is aborted with an error message

    An error occurred: You are not allowed to create a post in reply to another post.

    This is a not really helpful message. It does not tell what is wrong. In fact, if a reply is not allowed, it should not have allowed “quote-reply” in the first place at all.

  • When a reply is sent via email, the email just vanishes without the sender beeing informed. There should be a bounce with an explanatory message saying what is wrong.

  • Only comments are allowed. But they swallow some formatting (e.g. quotes, see the comment on :arrow_upper_right: this post), and also they are limited in numbers of characters, prohibiting more complex thoughts.

Regards!

4 Likes

A post was split to a new topic: How to hide the ‘add a comment’ option

@Discourse

comments on replies are hidden after 5 comments

How can I remove the 5 comment limit and make it appear only with the option to show comments?

Went searching for this same thing and was surprised it hadn’t been brought up before. Allowing the user to always end up in an error state with quotes and no option for markup in comments offers a very disjointed experience. Additionally, the error messaging is unclear for users when trying to directly reply to a post.

Definitely hoping to see an improvement to help polish this UX.

1 Like

After 5 comments, other comments are hidden
how do I make it so that after 1 or 2 comments other comments are hidden

A couple of questions about this great plugin:

  1. Why does the first post (the OP) get voting options? Surely that’s the question, so should not be voted on like it’s an answer?
  2. Any hints on some Badge SQL I can use to make badges out of these? Get 10 votes in a vote post topic, etc
?
1 Like

I found one for topic voting that can maybe be modified for post voting?

Is it possible to limit the number of downvotes that users can cast globally across all topics within a day, with this plugin?

Is it possible to move the location of this feature? Ideally we’d like to have it where the current double button like button is.

1 Like

I can’t @ a user when replying to a post in a voting post. Is this intentional or a bug?

1 Like

Within the comment rather than in a ‘proper’ reply? If so, I think that is intentional to keep the comments more lightweight than a full composer experience. This has been asked before (How to mention in Discourse comments, or disable commenting?), but I don’t think a Feature request was submitted in the end.

2 Likes

I think this also. :slight_smile: But Sam is adamant that it is a thing:

It doesn’t look like there are any badges knocking around for this yet.

If you have specific badge criteria for any you’d like to create you should fire up a Data & reporting topic for each one. :+1:

I think a couple of examples could be along the lines of:

get 10 votes on a post voting reply

SELECT p.user_id, p.created_at AS granted_at, p.id AS post_id
FROM post_voting_votes pvv
  JOIN posts p ON p.id = pvv.votable_id
WHERE pvv.direction = 'up'
  AND p.post_number <> 1
  AND (:backfill OR p.id IN (:post_ids))
GROUP BY p.user_id, p.id
HAVING COUNT(*) >=10

Or a slightly more nuanced one where you accounted for ‘up - down’ votes:

WITH vote_totals AS (

SELECT 
    p.user_id,
    p.id AS post_id,
    p.created_at AS granted_at,
    (COUNT(*) FILTER (WHERE pvv.direction = 'up') - COUNT(*) FILTER (WHERE pvv.direction = 'down')) AS total
FROM post_voting_votes pvv
  JOIN posts p ON p.id = pvv.votable_id
WHERE p.post_number <> 1
GROUP BY 1, 2

)

SELECT *
FROM vote_totals 
WHERE total >= 10
  AND (:backfill OR post_id IN (:post_ids))

:red_exclamation_mark: These will need some further testing to make sure they’re working as intended. :slight_smile:

Though one thing to consider is that the total is dynamic so a ‘10’ today could turn into a ‘5’ tomorrow if more downvotes are added (for the second example). And if the badge is just based on upvotes like the first example then you may have got 10, but the UI only shows 5 when the downvotes are totalled in.

5 Likes

Hi, just activated that plugin on a French site and noticed the wrong French translation for the second option in the category settings:

Les nouveaux sujets ne peuvent ĂȘtre que des sujets postĂ©rieurs au vote dans cette catĂ©gorie.

It should be:

Les nouveaux sujets ne peuvent ĂȘtre que des sujets de vote de message dans cette catĂ©gorie.

explanation: confusion between “post” as a message that can be a post and post as “posterior”, meaning after.

Hi, also is it possible to activate posts voting for topics that have already been published ? Thanks

:partying_face: This plugin is now bundled with Discourse core as part of Bundling more popular plugins with Discourse core. If you are self-hosting and use the plugin, you need to remove it from your app.yml before your next upgrade.

1 Like