Hello, my dear friends and colleges!
Since this question pops up periodically, I decided to put all information together in one post.
For creating sharing buttons/links on dynamic templates, we will use the awesome method described by @Waldo ( FREEBIE: Sharing is Caring :) - Show & Tell - Forum | Webflow ) and a little bit custom code.
STEP 1.
Follow @Waldoās method and create needed buttons in Webflow. Give it classes, style it as you want, use the background image (icon) or words, whatever you need to get finished styled buttons.
In this case, for example, I created class social-share-btn and comboclasses for each social network I want to use: fb, tw, gplus, pin,tmb, email, pinb, lnk, redd
STEP 2.
Next step, use the embed code component and add any of the snippets showed below:
IMPORTANT NOTE: Dont forget to add class w-inline-block for be able to see your share buttons in the designer mode.
FACEBOOK SHARE
<a class="w-inline-block social-share-btn fb" href="https://www.facebook.com/sharer/sharer.php?u=&t=" title="Share on Facebook" target="_blank" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(document.URL) + '&t=' + encodeURIComponent(document.URL)); return false;"> </a>
TWITTER SHARE
<a class="w-inline-block social-share-btn tw" href="https://twitter.com/intent/tweet?" target="_blank" title="Tweet" onclick="window.open('https://twitter.com/intent/tweet?text=%20Check%20up%20this%20awesome%20content' + encodeURIComponent(document.title) + ':%20 ' + encodeURIComponent(document.URL)); return false;"></a>
(Text here >>> ā%20Check%20up%20this%20awesome%20contentā you can change on whatever you want, just donāt forget to change the spaces to ā%20ā)
GOOGLE+ SHARE
<a class="w-inline-block social-share-btn gplus" href="https://plus.google.com/share?url=" target="_blank" title="Share on Google+" onclick="window.open('https://plus.google.com/share?url=' + encodeURIComponent(document.URL)); return false;"></a>
PINTEREST SHARE
<a class="w-inline-block social-share-btn pin" href="http://pinterest.com/pin/create/button/?url=&description=" target="_blank" title="Pin it" onclick="window.open('http://pinterest.com/pin/create/button/?url=' + encodeURIComponent(document.URL) + '&description=' + encodeURIComponent(document.title)); return false;"></a>
TUMBLR SHARE
<a class="w-inline-block social-share-btn tmb" href="http://www.tumblr.com/share?v=3&u=&t=&s=" target="_blank" title="Post to Tumblr" onclick="window.open('http://www.tumblr.com/share?v=3&u=' + encodeURIComponent(document.URL) + '&t=' + encodeURIComponent(document.title)); return false;"></a>
SHARE VIA E-MAIL
<a class="w-inline-block social-share-btn email" href="mailto:?subject=&body=:%20" target="_blank" title="Email" onclick="window.open('mailto:?subject=' + encodeURIComponent(document.title) + '&body=' + encodeURIComponent(document.URL)); return false;"></a>
PINBOARD SHARE
<a class="w-inline-block social-share-btn pinb" href="https://pinboard.in/popup_login/?url=&title=&description=" target="_blank" title="Save to Pinboard" onclick="window.open('https://pinboard.in/popup_login/?url=' + encodeURIComponent(document.URL) + '&title=' + encodeURIComponent(document.title)); return false;"></a>
LINKEDIN SHARE
<a class="w-inline-block social-share-btn lnk" href="http://www.linkedin.com/shareArticle?mini=true&url=&title=&summary=&source=" target="_blank" title="Share on LinkedIn" onclick="window.open('http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(document.URL) + '&title=' + encodeURIComponent(document.title)); return false;"></a>
REDDIT SHARE
<a class="w-inline-block social-share-btn redd" href="http://www.reddit.com/submit?url=&title=" target="_blank" title="Submit to Reddit" onclick="window.open('http://www.reddit.com/submit?url=' + encodeURIComponent(document.URL) + '&title=' + encodeURIComponent(document.title)); return false;">Reddit</a>
Buttons will share the particular page, where they are, take a title of the page and og image. Can be used on static pages same as on dynamic pages.
If on step 1 you created buttons with images or text inside, then you will have to add that element in this html snippets, between <a>
and </a>
Hope this information will be helpful for you, guys.
Regards,
Anna.