# Share badges on social media

**URL:** https://meta.discourse.org/t/share-badges-on-social-media/51998
**Category:** Feature
**Created:** [October 25, 2016, 10:10am UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998 "2016-10-25T10:10:20Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![foloex](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/foloex/32/63141_2.png) [@foloex](https://meta.discourse.org/u/foloex)
#### Post date: [October 25, 2016, 10:10am UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/1 "2016-10-25T10:10:20Z")

</div>

Hello world,

I’m trying to enhance my community activeness. In order to do so, I’d like my members to be able to brag about obtaining a badge on social media. It would reinforce the gamification aspect of the forum and lead the community into wanting to obtain badges, thus increasing the overall activity.

Is there a way to share a badge on social media (mainly facebook and twitter) ? If not, what kind of development would it take to do so ? I’m willing to make a plugin if it’s what it takes.

Best regards,

Rémi

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 25, 2016, 1:43pm UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/2 "2016-10-25T13:43:51Z")

</div>

I think that adding the necessary `og` tags on the [badges page](https://meta.discourse.org/badges/39/empathetic?username=falco) is welcome as a PR to the core.

---

<div class="post-metadata">

### Author: ![foloex](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/foloex/32/63141_2.png) [@foloex](https://meta.discourse.org/u/foloex)
#### Post date: [October 25, 2016, 2:02pm UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/3 "2016-10-25T14:02:58Z")

</div>

Yeah, that too, it would be nice to have the icon and description in the metadata. So if I understand you correctly, metadata description should be handled in the core of the forum and the share button should be a plugin, right ?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 25, 2016, 2:05pm UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/4 "2016-10-25T14:05:47Z")

</div>

> [@foloex](#):
>
> metadata description should be handled in the core of the forum

Yes!

> [@foloex](#):
>
> the share button should be a plugin

I’m not sure yet.

Do the metadata first, and wait for @codinghorror call on the share button ok?

---

<div class="post-metadata">

### Author: ![foloex](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/foloex/32/63141_2.png) [@foloex](https://meta.discourse.org/u/foloex)
#### Post date: [October 25, 2016, 2:09pm UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/5 "2016-10-25T14:09:40Z")

</div>

I’ll try to see what I can do, I never dived into the core of discourse and I’m not really familiar with ruby. But that sounds like a fun challenge 😉

---

<div class="post-metadata">

### Author: ![7ev3n](https://avatars.discourse-cdn.com/v4/letter/7/858c86/32.png) [@7ev3n](https://meta.discourse.org/u/7ev3n)
#### Post date: [March 17, 2017, 8:33am UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/6 "2017-03-17T08:33:25Z")

</div>

I believe metadata description to the [badges](https://meta.discourse.org/badges/1/basic?username=7ev3n) page can be added by making a new view badges/show.html.erb which has crawlable\_meta\_data as content\_for head.

I also changed the show method in badges\_controller to render to :show , instead of default/empty .

Am unable to see the changes (og tags) in the local instance of discourse set up using vagrant. I am new to the community and would appreciate help with this!

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [March 17, 2017, 9:06am UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/7 "2017-03-17T09:06:14Z")

</div>

Hi 7ev3n welcome to the forum

Did you see this?

> [@Project ideas for Google Summer of Code 2017](https://meta.discourse.org/t/project-ideas-for-google-summer-of-code-2017/57173/7):
>
> It’s explained in the Ideas List as well as the [Application Guide](https://github.com/discourse/discourse/wiki/GSoC-Application-Guide). Read our [Contribution Guidelines](https://meta.discourse.org/t/discourse-development-contribution-guidelines/3823). Find some #pr-welcome and/or #starter-task::tag topics that you’d feel comfortable diving into.

---

<div class="post-metadata">

### Author: ![7ev3n](https://avatars.discourse-cdn.com/v4/letter/7/858c86/32.png) [@7ev3n](https://meta.discourse.org/u/7ev3n)
#### Post date: [March 17, 2017, 9:51am UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/8 "2017-03-17T09:51:18Z")

</div>

Thank you 🙂

Yes. I have gone through the resources provided there, and have a basic idea about the code structure of Discourse.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [March 20, 2017, 3:45pm UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/9 "2017-03-20T15:45:57Z")

</div>

> [@7ev3n](#):
>
> I believe metadata description to the badges page can be added by making a new view badges/show.html.erb which has crawlable\_meta\_data as content\_for head.

That sounds correct.

> [@7ev3n](#):
>
> Am unable to see the changes (og tags) in the local instance of discourse set up using vagrant.

That is odd. I can see the og (Open Graph) tags just fine on my local dev instance if I create `badges/show.html.erb` file and removing `render "badges/show"` in controller.

Perhaps try again, and see `index` method in `CategoriesController` for reference implementation?

---

<div class="post-metadata">

### Author: ![7ev3n](https://avatars.discourse-cdn.com/v4/letter/7/858c86/32.png) [@7ev3n](https://meta.discourse.org/u/7ev3n)
#### Post date: [March 21, 2017, 2:34pm UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/10 "2017-03-21T14:34:25Z")

</div>

Am able to see the change now. Instead of render :show, I left it as render only.

I have submitted a [PR](https://github.com/discourse/discourse/pull/4773) for the same. Should the share button be added as a plugin, or in the core?

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [March 21, 2017, 8:52pm UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/11 "2017-03-21T20:52:25Z")

</div>

> [@7ev3n](#):
>
> Should the share button be added as a plugin, or in the core?

Might as well start it off as a plugin; will be a worthwhile exercise 😉

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [April 6, 2017, 4:08am UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/12 "2017-04-06T04:08:48Z")

</div>

This feature is now available via:

[https://github.com/discourse/discourse/commit/402eaaa7733405f926d04f23704b1a69e8088890](https://github.com/discourse/discourse/commit/402eaaa7733405f926d04f23704b1a69e8088890)

Thanks @7ev3n.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [September 11, 2017, 8:34am UTC](https://meta.discourse.org/t/share-badges-on-social-media/51998/13 "2017-09-11T08:34:17Z")

</div>


