Social Sharing MODX
Add social sharing links and buttons without the bloat for MODX Revolution (based on Social Sharing).
The widgets provided by Twitter, Facebook, and other services require numerous HTTP requests and can really hurt the performance of your sites and apps. These simple CSS and HTML snippets make it easy for you to go social - without hurting site performance.
How It Works
MODX tag that are used
- [[*longtitle:empty=`[[*pagetitle]]`]] - The longtitle of the page (if it is empty the pagetitle is used)
- [[!++site_url]][[*uri]] - The URL of page
- [[*description]] - The page description
- [[*description]] - The page description
Extra Template Variables that are used (these need to be created)
- [[*social-sharing-modx_twitter_id]] - Needed for the Twitter ID
- [[*social-sharing-modx_pinterest_img]] - Needed for the Pinterest thumbnail
The MODX tags
Twitter
<a target="_blank" href="https://twitter.com/intent/tweet?text=[[*longtitle:empty=`[[*pagetitle]]`]]&url=[[!++site_url]][[*uri]]&via=[[*social-sharing-modx_twitter_id]]">Twitter</a>
Facebook
<a target="_blank" href="http://www.facebook.com/sharer/sharer.php?u=[[!++site_url]][[*uri]]">Facebook</a>
Google+
<a target="_blank" href="https://plus.google.com/share?url=[[!++site_url]][[*uri]]">Google+</a>
LinkedIn
<a target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url=[[!++site_url]][[*uri]]&title=[[*longtitle:empty=`[[*pagetitle]]`]]&summary=[[*description]]&source=[[!++site_url]][[*uri]]">LinkedIn</a>
Pinterest
<a target="_blank" href="http://pinterest.com/pin/create/button/?url=[[!++site_url]][[*uri]]&description=[[*description]]&media=[[++site_url]][[*social-sharing-modx_pinterest_img]]">Pinterest</a>
Changelog
- Version 1.0 (november 6, 2013)
- Initial release.
License
Social Sharing MODX is free to use under the MIT License.
Thanks
Social Sharing MODX is based on Social Sharing from Chris Ferdinandi. Forked and updated for MODX Revolution by Menno Pietersen from Any Screen Size