2009-05-06

Image

Del.icio.us bookmark button with counter for Blogger

You can add a del.icio.us bookmark button with counter which shows the number of users that share the current link for each post to your blog.

Login to Blogger. Go to Layout > EditHTML. Check Expand Widget Templates.

Find the portion of code given below.


<p class="post-footer-line post-footer-line-3">

Copy & Paste the code given below just below the above code.

<a expr:href='"http://del.icio.us/post?url="+ data:post.url + "&amp;title" + data:post.title' target='_blank'>add to del.icio.us</a>
saved by <span class='delsquare' expr:id='"a"+data:post.id'>0</span> users

<script type='text/javascript'>
function displayURL(data) {
var urlinfo = data[0];
if (!urlinfo.total_posts) return;
document.getElementById('a<data:post.id/>').innerHTML = urlinfo.total_posts;
}
</script>
<script expr:src = '"http://badges.del.icio.us/feeds/json/url/data?url= " + data:post.url + "&amp;callback=displayURL"'/>


CSS

Add this class in your CSS and use it with the above code.

.share-delicious{
margin-left:10px;
border-left:solid 1px #DEDEDE;
padding-left:36px;
font-size:11px;
line-height:18px;
float:left;
}

التعليقات:

  1. Another easier way is here: http://www.didiknow.com/2010/01/delicious-bookmark-button-link-for-your.html

    ReplyDelete

Total Pageviews