How to add FB social share icon?

How to add social share icon?

When i embeded this code (with the embed block) i get JS errors

Hey @Siton_Systems,

Put this code in the head of your page

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/fr_FR/sdk.js#xfbml=1&version=v2.10";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

And this code in an embeded

<div class="fb-share-button" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button_count" data-size="small" data-mobile-iframe="true"><a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse">Partager</a></div>

Hope this helps

1 Like

Thanks. I hope in the future Webflow will add Share block beacuse “by code” sometimes the FB could change.

1 Like

Thanks that works, but I suggest to make the code for the embed like this (if used inside the cms template):
(in this case and after using your cms page address you will have a facebook white icon as SVG image in size 22 px/ size can be adjusted in the code also)

<div class="fb-share-button" data-href="https://www.yourwebsite.com/your cms template address/YOUR SLUG (added from add field in the code window" data-layout="button_count" data-size="small" data-mobile-iframe="true"><a class="222" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://www.yourwebsite.com/your cms template address/YOUR SLUG (added from add field in the code window"><img src="https://uploads-ssl.webflow.com/5b98c4400f6a63c23a0ebcab/5b98c4400f6a63277e0ebcb4_facebook-icon.svg" title="Share on facebook" width="22"height="22" /></a></a></div>

thanks
[/quote]

thanks

  1. Choose URL or Page. Pick the URL of a website or Facebook Page you want to share .
  2. Code Configuration. Paste the URL to the Code Configuration and adjust the layout of your share button. …
  3. Copy & Paste HTML snippet. Copy and past the snippet into the HTML of the destination website.