Saturday, February 21, 2009

How to add DIGG button to Blogger

Digg says that they are democratizing digital media because their users participate in determining Digg site content by discovering, selecting, sharing, and discussing the content that appeals to them. You have to become a member of Digg in order to participate. Once you are registered, as you navigate the internet, you can recommend content that you like for Digg. The recommendation happens through the site's Digg button that's typically either at the beginning or the bottom of a post, news story, picture or video. That is what I am going to show you in this post - how to add Digg buttons to each Blogger post.

From LAYOUT, go to EDIT HTML and check the Expand Widgets box at top right. Then search for (Ctrl F) data:post.body which is where the Blogger posts are being processed. Insert the following code BEFORE data:post.body:

<div style='float:right; margin-left:15px;'>
<script type='text/javascript'>
// setting digg_url variable to current post URL
digg_url = '<data:post.url/>';
</script>
<!-- pull in digg script that will use the digg_url variable -->
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>


This will create a Digg button to the right of each post at the top. If for some reason you run into trouble with Blogger issuing you an error message and not saving your changes then there's an extra step that you need to do.

In Firefox, Go under Tools and Choose Clear Private Data and then make sure your cookies are all deleted. After deleting the cookies, add your lines and save again.

If you want to add Digg to the left of your post, then use the following code as your first line:
<div style='float:left; margin-right:15px; margin-top:7px;'>

Post a Comment

Note: Only a member of this blog may post a comment.