# How to add buttons will be shared in VK and OK?

**URL:** https://meta.discourse.org/t/how-to-add-buttons-will-be-shared-in-vk-and-ok/68463
**Category:** Support
**Created:** [21 augustus 2017 om 11:41 UTC](https://meta.discourse.org/t/how-to-add-buttons-will-be-shared-in-vk-and-ok/68463 "2017-08-21T11:41:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![11145](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/11145/32/119636_2.png) [@11145](https://meta.discourse.org/u/11145)
#### Post date: [21 augustus 2017 om 11:41 UTC](https://meta.discourse.org/t/how-to-add-buttons-will-be-shared-in-vk-and-ok/68463/1 "2017-08-21T11:41:17Z")

</div>

How to add buttons to share in social networks VK and OK?

 ![2017-08-21_14-38-42](https://global.discourse-cdn.com/meta/original/3X/4/9/49cf2a6f2e5672632762e70f2ee1bef09214f9ea.jpg)

---

<div class="post-metadata">

### Author: ![Stranik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stranik/32/85638_2.png) [@Stranik](https://meta.discourse.org/u/Stranik)
#### Post date: [22 augustus 2017 om 08:17 UTC](https://meta.discourse.org/t/how-to-add-buttons-will-be-shared-in-vk-and-ok/68463/2 "2017-08-22T08:17:37Z")

</div>

You can also try

```
<script type="text/discourse-plugin" version="0.4">

 api.decorateWidget('topic-map:before', dec => {
     
 const link = window.location.href;
 const urlfb = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(link);
 const urlok = "http://www.ok.ru/dk?st.cmd=addShare&st.s=1&st._surl=" + encodeURIComponent(link);
 const urlvk = "https://vk.com/share.php?url=" + encodeURIComponent(link);
 
 return dec.rawHtml(`
 <div class="test"><a class="fb" href="${urlfb}" target="_blank"><i class="fa fa-facebook fa-lg" aria-hidden="true"></i></a>
 <a class="ok" href="${urlok}" target="_blank"><i class="fa fa-odnoklassniki fa-lg" aria-hidden="true"></i></a>
  <a class="vk" href="${urlvk}" target="_blank"><i class="fa fa-vk fa-lg" aria-hidden="true"></i></a>
  </div>`);
  });
  
</script>

```

 ![11](https://global.discourse-cdn.com/meta/original/3X/7/b/7bc519b25445a732249c5ee3abfe7480adb3289e.jpg)

**CSS** -

```
.test {
    display: inline-block;
    margin-top: -50px;
    position: absolute;
}
.test a.ok{
    margin-left: 15px;
    margin-right: 15px;
}
.test a{color: #999;}
.test a:hover{color: #666;}

```

I tried it, do not know right or wrong. Div are, you can change the design as you wish…

---

<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: [15 juni 2018 om 16:33 UTC](https://meta.discourse.org/t/how-to-add-buttons-will-be-shared-in-vk-and-ok/68463/3 "2018-06-15T16:33:17Z")

</div>

The theme component to add an extra social button 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…

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [15 juni 2018 om 22:00 UTC](https://meta.discourse.org/t/how-to-add-buttons-will-be-shared-in-vk-and-ok/68463/4 "2018-06-15T22:00:01Z")

</div>

This topic was automatically closed after 5 hours. New replies are no longer allowed.
