Implement social media share buttons?
You need to implement the ability to publish on social networks through the site. I tried, for example, in vk the following:
url = 'http://vk.com/share.php?';
url += 'url=' + encodeURIComponent('mysite.com');
url += '&title=' + encodeURIComponent('title');
url += '&description=' + encodeURIComponent('description');
url += '&noparse=true';
window.open(url,'','toolbar=0,status=0,width=626,height=436');
But I was faced with the fact that the description comment section of the post (in the popup) is not filled in. Plus, the {[5] button doesn't work in the popup itself]}tell your friends on the page, but the moment works if you send the record by private message.
I tried the option from the docks vk, problems identical:
<script type="text/javascript" src="https://vk.com/js/api/share.js?93" charset="windows-1251"></script>
<script type="text/javascript">
...
document.write(VK.Share.button({
url: 'http://mysite.com',
title: 'Заголовок страницы',
description: 'Это мой собственный сайт, я его очень долго делал',
image: 'http://mysite.com/mypic.jpg',
noparse: true
}));
Is there any ready-made basic template for sharing in social networks (without downloading packages in npm)?
I should have vk, fb, twitter.
1 answers
I used it for a while http://share42.com/ru
Fast and convenient.
We stumbled on some icons, loaded the script, stuck the code below (or similar for the cms, there is everything on the page), and hooray. :)
There are also a lot of settings, for the descriptor and the rest. You can push variables there.
<div class="share42init"></div>
<script type="text/javascript" src="http://site.name/share42/share42.js"></script>