# Add VK share for topics

**URL:** https://meta.discourse.org/t/add-vk-share-for-topics/77428
**Category:** Support
**Created:** [1월 7, 2018, 10:23오후 UTC](https://meta.discourse.org/t/add-vk-share-for-topics/77428 "2018-01-07T22:23:24Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Denis\_Frosty\_Andreyc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denis_frosty_andreyc/32/87114_2.png) [@Denis\_Frosty\_Andreyc](https://meta.discourse.org/u/Denis_Frosty_Andreyc)
#### Post date: [1월 7, 2018, 10:23오후 UTC](https://meta.discourse.org/t/add-vk-share-for-topics/77428/1 "2018-01-07T22:23:24Z")

</div>

Can I allow user to share their topics in VK ([vk.com](http://vk.com))? I need to add a new button like facebook or twitter.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [6월 12, 2018, 9:52오후 UTC](https://meta.discourse.org/t/add-vk-share-for-topics/77428/2 "2018-06-12T21:52:14Z")

</div>

Do we have a tutorial for this @dax? Might be a good thing to have, if someone wants to customize the share buttons or add a new one.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [6월 13, 2018, 11:29오전 UTC](https://meta.discourse.org/t/add-vk-share-for-topics/77428/4 "2018-06-13T11:29:51Z")

</div>

@techAPJ could you review this please:

[https://github.com/discourse/discourse/pull/5991](https://github.com/discourse/discourse/pull/5991)

It will allow to have this code:

```plaintext
<script type="text/discourse-plugin" version="0.8.23">
  api.addSharingSource({
    id: "vk",
    icon: "vk",
    generateUrl: function(link, title) {
      return "http://vk.com/share.php?url=" + encodeURIComponent(link) + "&title=" + 
encodeURIComponent(title);
    },
    shouldOpenInPopup: true,
    popupHeight: 265
  })
</script>

```

Which will display the VK sharing icon correctly:

 ![17](https://global.discourse-cdn.com/meta/original/3X/b/6/b695a3dd3fdd138ea0fc4a216214abfd05c46920.png)

Concerning this pull request, reading it you will notice that I added a method to bypass the existing site setting. The reasoning behind is that it’s probably a very good use case for theme components, that way we can keep core sharing methods (google+/facebook/twitter/email) and admin can decide which one he wants to show. But, plugins and theme components can have more control and extend the site setting if only some users wants to use a theme component to have sharing to specific third party.

---

<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: [6월 13, 2018, 11:55오전 UTC](https://meta.discourse.org/t/add-vk-share-for-topics/77428/5 "2018-06-13T11:55:53Z")

</div>

> [@j.jaffeux](#):
>
> it’s probably a very good use case for theme components, that way we can keep core sharing methods (google+/facebook/twitter/email) and admin can decide which one he wants to show. But, plugins and theme components can have more control and extend the site setting if only some users wants to use a theme component to have sharing to specific third party.

Sounds good to me. PR merged. 👍

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [6월 13, 2018, 9:24오후 UTC](https://meta.discourse.org/t/add-vk-share-for-topics/77428/6 "2018-06-13T21:24:15Z")

</div>



---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [6월 15, 2018, 4:31오후 UTC](https://meta.discourse.org/t/add-vk-share-for-topics/77428/7 "2018-06-15T16:31:49Z")

</div>

The theme component is now ready

> [@Social Share](https://meta.discourse.org/t/social-share-component/89980):
>
> discourse2Summary Social Share allows you to easily add extra social providers to the share button on posts..eyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/social-share)hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-social-share](https://github.com/discourse/discourse-social-share)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features information_source This component only works on public sites. Share icons will be aut…
