Homepage | About Me | Testing ASP.net Book | Best Blog Posts | Personal Projects | Follow me on Twitter | GitHub | SlideShare | RSS
Blog.BenHall.me.uk

Add link building links your blogger posts

Monday, April 09, 2007

Tonight I finally got around to adding various links to the bottom of my posts, the "Share this post" links you see on the bottom of various blogs.

As you might tell from the template, I use blogger as my blogging software (might switch soon)

The HTML for the links is below, the first block is for the new blogger templates which use the new data format. For example, data:post.url is the URL of the post, while data:post.title is the title.

<!-- Share this post code - Ben Hall - Blog.BenHall.me.uk -->
<b>Share this post: </b>
<a expr:href='"mailto:?body=Thought you might like this: " + data:post.url + "&subject=" + data:post.title'>Email It!</a> |
<a expr:href='"http://del.icio.us/post?url=" + data:post.url + "&title=" + data:post.title' target='_blank'>Bookmark It!</a> |
<a expr:href='"http://www.digg.com/submit?url=" + data:post.url + "&phase=2"' target='_blank'>Digg It!</a> |
<a expr:href='"http://reddit.com/submit?url=" + data:post.url + "&title=" + data:post.title' target='_blank'>Reddit It!</a> |
<a expr:href='"http://www.dotnetkicks.com/kick/?url=" + data:post.url + "&title=" + data:post.title' target='_blank'>Kick It!</a> |
<a expr:href='"https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=" + data:post.url + "&title=" + data:post.title + "&top=1"' target='_blank'>Live It!</a><br />

 

If your still using the old blogger templates, then the format to access information about the post is sightly different.

 

<!-- Share this post code - Ben Hall - Blog.BenHall.me.uk -->
<b>Share this post: </b>
<a href="mailto:?body=Thought you might like this: <$BlogItemPermalinkUrl$>&subject=<$BlogItemTitle$>" Title="Email It!">Email It!</a> |
<a href="http://del.icio.us/post?url=<$BlogItemPermalinkUrl$>&title=<$BlogItemTitle$>" target="_blank" Title="Bookmark It!">Bookmark It!</a> |
<a href="http://www.digg.com/submit?url=<$BlogItemPermalinkUrl$>&phase=2"' target="_blank" Title="Digg It!">Digg It!</a> |
<a href="http://reddit.com/submit?url=<$BlogItemPermalinkUrl$>&title=<$BlogItemTitle$>" target="_blank" Title="Reddit It!">Reddit It!</a> |
<a href="http://www.dotnetkicks.com/kick/?url=<$BlogItemPermalinkUrl$>&title=<$BlogItemTitle$>" target="_blank" Title="Kick It!">Kick It!</a> |
<a href="https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=<$BlogItemPermalinkUrl$>&title=<$BlogItemTitle$>&top=1" target="_blank" Title="Live It!">Live It!</a><br />

Just place the code in your template where you want the links to appear.  Hope this helps!

Blogger comments

At 3:18 PM, Blogger Manesntails said...
Great stuff
Joules    
At 4:53 PM, Anonymous tax said...
thanks ;)

Tax    
At 11:36 PM, Anonymous Boxers said...
Very Cool...many thanks    
At 8:30 PM, Anonymous Female said...
Cheers Man, spot on!    
At 12:26 AM, Blogger John Sawyer said...
This post has been removed by the author.    
At 1:14 AM, Blogger John Sawyer said...
The latest version of the edit template seemed to want '&Subject' to finish with a ;

I found this to work:

The &Subject= should be be replaced by:

&amp;Subject=