Finally, added the Digg button to the blog. But I still didn’t manage to change the template.
Tips-for-new-bloggers, has tutorial on how to add the dig button to the template. It asks to find the following line of code in the template:
<p><data:post.body/></p>
And then asks to add the following code on top of that line or below it depending on whether you need your dig at the top or bottom of your post.
<div style='float:right; margin-left:10px;'>
<script type='text/javascript'>
digg_url="<data:post.url/>";
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/></script>
</div>
<script type='text/javascript'>
digg_url="<data:post.url/>";
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/></script>
</div>
When I do this, blogger takes me to a error page.

I searched the web for some other way, but almost all of them have got the same way of adding the Digg button. Failing in my attempts to add Digg button through a template fix, I decided to add it in each and every post.
First, publish your post. Then add the following code to the beginning of your post, by editing it:
<script type="text/javascript">
digg_url = 'WEBSITE_URL'
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
digg_url = 'WEBSITE_URL'
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
Replace WEBSITE_URL with the URL of your blog post. Voila! You should see the Digg button!
But there is one trivial problem, the Digg button may seem out of place from your post. The text and button may be disjoint.

You can fix it easily by borrowing from the previous template fix discussed. Place the <div style='float:right; margin-left:10px;'> before the script tag and close it at the end. Like this:
<div style='float:right; margin-left:10px;'>
<script type="text/javascript">
digg_url = 'WEBSITE_URL'
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
<script type="text/javascript">
digg_url = 'WEBSITE_URL'
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
You should see a digg button that seems to merge with your post.

Remember, you still need to change WEBSITE_URL with the URL of your post. Otherwise you will be digging your blog rather than a specific blog post.
But there is one disadvantage with this method, you need to do this for every post, unlike the template fix.
If anyone is aware of a working template fix please do mention it, in the comment section.
Home

1 comments:
I'm delighted that I have observed this weblog. Finally anything not a junk, which we go through incredibly frequently. The website is lovingly serviced and kept up to date. So it need to be, thank you for sharing this with us.
windows 7
Post a Comment