Can I use the ShareThis API with Blogger?
Yes, the ShareThis API (STAPI) can be used within the Blogger template. The following steps will guide you how to manually insert the ShareThis button into your Blogger template using the STAPI. This button will appear at the end of each post’s content before the footer and share a link to the corresponding blog post.
- Visit http://sharethis.com/publisher and follow the steps to customize your ShareThis widget and to get the widget code
- Sign into the Blogger Dashboard and select “Layout” from the “Manage” listing
- Select the “Edit HTML” tab
- Check the “Expand Widget Templates” checkbox
- Paste the ShareThis widget code just before the closing </head> tag
- Locate the following lines of code within the template:
<div class=’post-body entry-content’>
<p><data:post.body/></p>
- Insert the STAPI code between the lines above. This will create your ShareThis button. For example:
<div style=’clear: both;’/> <!– clear for photos floats –></div>
<div class=’post-body entry-content’> //The div that contains the blog post
<p><data:post.body/></p> //This is the body of the post
<script type=’text/javascript’> //Sharelet code
SHARETHIS.addEntry({
title: ‘<data:post.title/>’, //ShareThis Object Properties
url: ‘<data:post.url/>’
});
</script><div style=’clear: both;’/>
</div>
- View your blog and try out your new ShareThis button
*The ShareThis Object Properties above are assigned to the title and permalink of each post using the Blogger template tags. You can find more information on Blogger template tags here.
*If you copied and pasted any of the code above, please double check and ensure that all of single quotation marks did not copy as backticks ” ‘ ” as this will cause validation errors.
Popularity: 10%
