# Add additional button post menu

**URL:** https://meta.discourse.org/t/add-additional-button-post-menu/149439
**Category:** Development
**Created:** [April 27, 2020, 11:27am UTC](https://meta.discourse.org/t/add-additional-button-post-menu/149439 "2020-04-27T11:27:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![marek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marek/32/178390_2.png) [@marek](https://meta.discourse.org/u/marek)
#### Post date: [April 27, 2020, 11:27am UTC](https://meta.discourse.org/t/add-additional-button-post-menu/149439/1 "2020-04-27T11:27:05Z")

</div>

Hey.  
I’m quite new to Discourse plugin making, but I was wondering if anyone could help me explaining how to add additional button to post menu. As far as I can see, this should be handled via custom plugin.  
For example, `Made you laugh` button, that would behave in similar way as Like - storing how many people clicked it on post or comment.  
I’m aware of Retort plugin, but it won’t solve the problem for me, as I’m more like interested in understanding how to add this button.

---

<div class="post-metadata">

### Author: ![zcuric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zcuric/32/292837_2.png) [@zcuric](https://meta.discourse.org/u/zcuric)
#### Post date: [April 28, 2020, 7:55am UTC](https://meta.discourse.org/t/add-additional-button-post-menu/149439/2 "2020-04-28T07:55:54Z")

</div>

Hi,  
this is a tricky one. From my experience, this should go through a plugin. You’ll have to add additional button to `post-menu` widget, and you’ll have to add a migration to db to store your “made you laugh” reactions.

You could use discourse solved plugin for inspiration:  
[https://github.com/discourse/discourse-solved](https://github.com/discourse/discourse-solved)

This plugin also adds additional button to post menu and adds functionality that is stored in db.

Make sure you read the developers guide for building plugins:

> [@Developing Discourse Plugins - Part 1 - Create a basic plugin](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-1/30515):
>
> Building a plugin in Discourse can be really simple, once you learn a couple of quirks. The goal of this post is to create a skeleton plugin and introduce you to the basics. Your development environment Make sure you have a development environment of Discourse running on your computer. I recommend you use [the appropriate setup guide](https://meta.discourse.org/tag/dev-install) and come back when you’re done. plugin.rbtada Use [GitHub - discourse/discourse-plugin-skeleton: Template for Discourse plugins · GitHub](https://github.com/discourse/discourse-plugin-skeleton) to create a complete di…

Good luck.

---

<div class="post-metadata">

### Author: ![marek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marek/32/178390_2.png) [@marek](https://meta.discourse.org/u/marek)
#### Post date: [April 28, 2020, 2:56pm UTC](https://meta.discourse.org/t/add-additional-button-post-menu/149439/3 "2020-04-28T14:56:30Z")

</div>

Thanks a lot, @zcuric, I’ve tried to get understanding of this plugin, and Retort also, yet no luck so far, but will continue in this direction.  
Could you also, please, hint in what way Discourse manages render of Like button? Specifically, how does it hide Like button on your own posts? So I could do the same for my custom button.

---

<div class="post-metadata">

### Author: ![zcuric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zcuric/32/292837_2.png) [@zcuric](https://meta.discourse.org/u/zcuric)
#### Post date: [April 28, 2020, 3:08pm UTC](https://meta.discourse.org/t/add-additional-button-post-menu/149439/4 "2020-04-28T15:08:29Z")

</div>

@marek You are welcome. You’ll have read the code a bit, starting from here:

[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/app/widgets/post-menu.js#L122](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/app/widgets/post-menu.js#L122)

Regarding backend it is API request 99%. I didn’t go much into it. Probably an endpoint. My guess is when building a plugin you’ll have to do a **REST API routes with GET, POST, DELETE endpoints** that will fill the data your field in database which you added by **database migration** and that will be done with Rails. At least that’s how I would approach the situation.
