September 2, 2006

Del.icio.us and Digg hotlinks for your Beta blog

[Translations by other bloggers: Chinese]

Quite a few bloggers have hotlinks to social bookmarking websites such as Delicious and Digg so that visitors to their blog can quickly submit their posts. Vivek Sanghi identified that the method described in this post will not work for Beta blogs and also suggested that I could look into it. I did and got them working with this blog. You can find these links below any of my posts, next to the Labels.

If you want these hotlinks for your Beta blog, expand your template widgets and search for "post-labels". You will find the portion of code shown below. Insert the code in red before the /span tag.


<span class='post-labels'>
<b:if cond='data:post.labels'>
<data:postLabelsLabel/>
<b:loop values='data:post.labels' var='label'>
<a expr:href='data:label.url' rel='tag'>
<data:label.name/>
</a><b:if cond='data:label.isLast != "true"'>,</b:if>
</b:loop>
</b:if>

  <a expr:href='"http://digg.com/submit?phase=2&amp;url=" +
data:post.url + "&amp;title=" + data:post.title'
target='_blank'>DiggIt!</a>
  <a expr:href='"http://del.icio.us/post?url=" +
data:post.url + "&amp;title=" + data:post.title'
target='_blank'>Del.icio.us</a>

</span>


If you are familiar with the classic Blogger tags $BlogItemPermalinkUrl$ and $BlogItemTitle$, I have used their equivalents data:post.url and data:post.title here. You could hotlink to other bookmarking sites also using these.

32 comments:

  1. Yo man! super. Yet another useful hack for blogger beta and neatly done indeed.

    ReplyDelete
  2. Hey I have done some more work on this one. Check it out here:
    http://stubborn-fanatic.blogspot.com/2006/09/get-socially-bookmarked.html

    ReplyDelete
  3. great hacks!
    question:How can I create expandable post summaries in beta?

    ReplyDelete
  4. 8"o", I have a few requests for expandable post summaries. I will look into it once I am done with my current hacks.

    ReplyDelete
  5. Works perfectly on my blog. Thanks very much for another great hack.

    ReplyDelete
  6. what if the story is already in digg?how about a voting link to digg instead.

    ReplyDelete
  7. Can you post about how you got the adsense inside of your post. I have had trouble getting that to work.

    I can get adsense to work as a seperate "widget" but not by editing the html template.

    ReplyDelete
  8. Andrew, just remove the < !-- and -- > in the adsense code and it will work. I have reported this bug to Blogger support. You report it too.

    ReplyDelete
  9. Hi Ramani,

    i have post the problem to both adsense and blogger but yet seeing any reply....
    modified the adsense tamper their TOS...anyway, i do that trick too.
    hope it will be solved soon

    ReplyDelete
  10. I expanded my widgets and copied my code to notepad and searched for post-labels and even went through all of the /span in the HTML and didn't find this area. OY VEY!

    ReplyDelete
  11. Brent - you might want to try inserting after the code related to 'post-comment'link', directly before that /span.

    ReplyDelete
  12. Another wonderful hack, Ramani. Thank you so much for deconstructing Blogger Beta for us, and providing us with these great enhancements. :)

    Thanks again. :)

    ReplyDelete
  13. Hi Ramani,
    Great hack, i came across this site http://www.bookmarkz.net/ which supports for 94 unique social bookmarking services. Now the problem is it does not support Beta blog, so any hack to include this?

    ReplyDelete
  14. I've using an Iframe html tag for social bookmarking (Blogalaxia.com) do you know a hack for using IFRAME?...

    iframe src="http://rank.blogalaxia.com/pbrate.php?color=ffffff&url=<$BlogItemPermalinkURL$>" width=70 height=15 scrolling=no frameborder=0 marginheight=0 marginwidth=0 style='margin:0; padding:0'

    /iframe

    ReplyDelete
  15. Worked fabulously! Thank you!
    The lack of flexibility/ease of changing stuff in beta is one reason why I haven't moved all my blogs over to it yet. Your help is gravy dude!

    ReplyDelete
  16. This is perfect. Thank you so much for sharing your hard earned hacks. Cheers.

    ReplyDelete
  17. This chunks when you have apostrophes in the title right?

    ReplyDelete
  18. yes, i think so. apostrophe will cause problem for this hotlink.

    ReplyDelete
  19. Any ideas on how to get around this? It is kinda important to allow apostrophe's in posts.

    ReplyDelete
  20. Hi all, I found the tricks at this blogger post, that allow Blogger beta to embed adsense code in post body, without the need to tamper original adsense code or against the TOS.

    ReplyDelete
  21. Thank you! You have saved me a ton of work.

    ReplyDelete
  22. I found way to implement the actual Digg Box in your Beta blog posts!

    Integrating the Digg Box in your Blogger Beta Posts
    http://tekartist.blogspot.com/2006/12/integrating-digg-box-in-your-blogger.html

    ReplyDelete
  23. As always, a very useful tip, and one that I stole immediately!

    Thanks again for all your hard work that makes it easy for us idiots out there!

    ReplyDelete
  24. Cool! First hack that I was able to understand. (Don't know much about these stuff but it's really fun! LOL) Do you know a way to get the little icons in??

    ReplyDelete
  25. There's a similar hack with icons at Beautifulbeta.blogspot.com. c

    ReplyDelete
  26. Many thanks for the syntax

    ReplyDelete
  27. cool work.But did u know feedburner also offers this service through feeflare? visit it for a sample
    Webmaster Centeral

    ReplyDelete
  28. Excellent! Exactly what I was looking for, clearly presented. Kudos!

    ReplyDelete
  29. thx. simple and it's easy to use with any other service

    ReplyDelete
  30. Guradian,

    I added link to this translation and also the drop-down labels translation. Thanks for translating many hacks and help spreading my work.

    ReplyDelete
  31. Thank you so much.

    ReplyDelete

Dear Visitor,

All the hacks in this blog are proven to work. If some hack doesn't work for you, please re-read the instructions carefully and re-check the code.

-Ramani