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:

Vivek Sanghi said...

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

Vivek Sanghi said...

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

坚硬的泡沫 said...

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

Unknown said...

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

dreamkatcha said...

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

Boy said...

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

Andrew Roberts said...

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.

Unknown said...

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.

Anonymous said...

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

merlinhoot said...

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!

Rod Oracheski said...

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

Caylynn said...

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

Thanks again. :)

Ameet said...

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?

vgarcias said...

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

janeandchris said...

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!

Anonymous said...

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

Anonymous said...

This chunks when you have apostrophes in the title right?

Unknown said...

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

grouprecipes said...

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

Anonymous said...

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.

Jason said...

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

stephdau said...

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

T-T-Tommy said...

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!

The.Digital.Life said...

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??

Unknown said...

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

Riot said...

Many thanks for the syntax

Anonymous said...

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

Karl said...

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

Anonymous said...

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

Ken Lai said...

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

Unknown said...

Guradian,

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

h@n| said...

Thank you so much.