How can I add "dislike" button?

(RJ) #14

Thanks @elijah, but this plugin has already been suggested two or 3 times and it’s not exactly what I’m looking for. I need those buttons because they need to tie into a reputation system at large. Basically this is becoming a huge disappointment in the software that I am unable to customize it how I’d like my forum to look…I wanted people to see the next-gen of forums, but you guys are not giving me any options in compromise for features people want to use. For our users, it’s not the point just to react to a post, but that their reaction means something within our forum ecosystem. I’m not looking for an “easy way” I have realized that it’s going to be “hard” to implement this, but again…I’m asking for a bit of direction from some knowledgeable members. Here’s what I’m asking for help on:

  • Someone pointing me to the functionality in the code so I can recreate it for 2 other buttons.

Is there anyone who knows how to do this?

(Felix Freiberger) #15

Sorry to point you at the Retort plugin again, but… it is open source! Feel free to take it, limit it to a dislike reaction and then tie these reactions into the trust level system as you see fit :slight_smile:

(RJ) #16

Ok I can try to do that. Now the only issue is how! :confounded:

(Sam Saffron) #17

If you want to swim in rapids upstream, asking for basic swimming lessons is only going to get you so far

(Christoph) #18

I don’t really have anything to add, but need at least 20 characters to be able to submit this :wink:

(RJ) #20

It always goes well when people think they know better than anyone else what people want. That was sarcasm, usually no one likes that guy. Too bad you guys feel the need to have 10 replies of why I shouldn’t do something instead of being of the spirit of actual free discourse. It’s like an echo chamber in here… “retort plugin…we don’t like dislike buttons…”

(Felix Freiberger) #21

What do you want, exactly? Neither Discourse core nor any plugin we know of implements a dislike button that affects trust levels. If you want that, someone has to create it.

If you want someone to create it for you, I recommend posting an offer in #marketplace – your chance of the team or someone else implementing it for themselves is pretty slim because it’s a rare request.

If you want to do it yourself, you’ll have to do the hard work yourself. I’m sure you’ll get helpful responses here if you stumble over something and ask a concrete question!

If you’re looking for the source code of the Retort plugin, it’s here. If you need general help on getting started to write plugins, here’s a guide by @eviltrout.

(RJ) #22

My issue is that there’s not a comprehensive api where I would access existing values. A la a plugin api. Looking at the Discourse github there’s a lot of files and for me, it’s kind of hard to traverse it looking for how ‘the like’ works when I don’t know the reference names even. Is it in the database? Is it an attribute? Very difficult to see, which of course is probably due to my inexperience but the fact remains plugin support and documentation seems severely lacking. Looking at the plugin guide it’s slanted towards admins customizations, instead of sitewide customizations. my whole point was if there is no access endpoint for “likes” where would I look to see the core functionality and extend it (especially when its more complicated than using handlebar outlet) ?

(RJ) #23

Or is there a debugger I can use that will show me the instance variables and routes by clicking and interacting with the web page?

(Felix Freiberger) #24

The Retort plugin is a small plugin (a few pages of code), and is incredibly close to what you want to do – it is just more general and lacks the ties into the trust level system. You definitely should start by understanding how it works!

(Christoph) #25

I agree (with the sarkasm). But the challenge is to find out what exactly people want. It’s a challenge because “people” implies diverse needs and opinions and you need to find a way to decide which path to take. This is why I quoted from “How does the Discourse project work”, not because I necessarily agree with all the criteria layed out there but because this is how the Discourse project works.

I wouldn’t say that “complaints driven software development” is much about "people knowing better than others. If were referring to the Discourse philosophy, then I wonder whether you mean to imply that there shouldn’t be any philosophy or whether anyone should be allowed to change it at will or whether you just wanted to call the “anti-downvote policy” into question.

If the latter is the case (which was how I understood you) you simply have to be aware that this goes very deep into the basic philosophy of Discourse, and to point that out was the only point of my post.

Although I do agree that the tone on this forum is not always as friendly and argument oriented as it could be, I would say that your request has been treated with much goodwill here, in spite of it going against the Discourse philosophy. The point of disagreement is probably in just how much an effort a community should make to assist a member in achieving something they themselves don’t really believe in.

(RJ) #26

I’m using it but I think I having the same issue as another user in that it’s not showing up in any of the posts and no errors. But of course I definitely will go through his code to understand how he did it since it’s so similar. Would you consider this relevant to what I’m trying to do? I found it in the plugin api file:


  • Add a new button below a post with your plugin.
  • The callback function will be called whenever the post menu is rendered,
  • and if you return an object with the button details it will be rendered.
  • Example:
  • api.addPostMenuButton(‘coffee’, () => {
  • return {
  • action: 'drinkCoffee',
  • icon: 'coffee',
  • className: 'hot-coffee',
  • title: 'coffee.title',
  • position: 'first'  // can be `first`, `last` or `second-last-hidden`
  • };
  • });

addPostMenuButton(name, callback) {
addButton(name, callback);

(RJ) #27

In truth, I do find the “philosophy” irrelevant. It’s not what attracted me to using this platform. I think it’s great they feel so strongly about their idea of a perfect community, but it’s a bit much to expect everyone who is taking advantage of the open-source nature to feel the same way especially when I’m not contributing in a development basis, but production. I’m not trying to dictate what they believe should be the core platform. This isn’t a feature request. I posted here because the people here are very knowledgeable about how this system works; as they should be they created it. I’m asking they share their knowledge so that I can be able to take full advantage. Yet people would rather tell you what they think you should have instead of answering your question. If it’s technically or logistically impossible, that makes sense but to stonewall me due to a purely philosophical basis is not open discourse or whatever they claim.

(Felix Freiberger) #28

I think this is relevant. Here’s why:

(RJ) #29

Thank you so much for connecting the dots!

(Graham Perrin) #30

^ :thumbsup:

I’m curious.

Are those users hesitant about flagging posts that don’t fit?

Do they, maybe, imagine that flagging will not lead to an agreeable outcome?

Are those users accustomed to the immediacy of publicly showing their distaste for something? (That’s not a loaded question. If that’s their habit, that’s just the way it is, no good pretending otherwise.)

Do they get a group feelgood factor from collective distaste?

The appearance of thick skin can be deceiving :slight_smile: but I guess that if a person will knowingly speak or write in an area where negativity is a feature, the person should be prepared to apply his or her own bandage after being cut.

Or (@mcbuzz) do your people club together to feel good after one person gets cut by a slash of negadisliky?

(Sam Saffron) closed #31

(Sam Saffron) opened #32

This topic was automatically opened after 3 days.

(Yu Gong) #33

Hi how did you use the post menu to add this kind of feature? :slight_smile:

There is the like count and like added as default in post menu but how do you use the post menu to additional such as the dislike? Or does discourse need to be self hosted to extend the post menu items?

(Mittineague) #34

I didn’t. I used the browsers developers tools to make edits to what was displayed.

AFAIK, the closest thing to a “dislike” feature at this time is still