I had migrated out of blogger in 2007. Reasons for which i’m not quite sure of. One thing that attracted me in WordPress is the availablity of plugins and the ease with which i was able to work with the php code. So when i had to do a ‘tweet this’ link for each post on my blog all i had to do was write this at the right place -
<a href="http://twitter.com/home?status=Now reading <?php the_permalink(); ?>" target="_blank">
<img src="http://jerrymannel.com/blog/wp-content/themes/SIM4.0/images/s-to-twit.jpg"
style="border:none;">
</a>
So yesterday, i was lazing around in the evening after a visit to the local library, one of my friends called. She was a smart-enough-techie for a business student. The only chick i knew who owned a Mac (i was so ready to dump all my girl-friends for her, coz she had a Mac. But her boy-friend owns an Audi so she ruled me out. 150cc Pulsar DTSi doest really stand a chance against an Audi). She had she blog up on blogger. Her problem how to get a ‘Tweet This’ link for each and every post on her blog.
I just dropped everything i was doing (nothing much infact) and got down to crack the problem. And this is how its done.
First get the full code for the .blogspot.com site that you have by navigating to Layout -> Edit HTML page. Check the “Expand Widget Templates” and copy the content of text area and back it up.
Next check the code that you have in had and make sure that its not the Classic Theme code. Just scroll and see you dont come across anything like <$BlogItemXXXXXXXXX$> in it.
Just like WordPress, blogger also loops and adds the blog entry(the simplest logic). So find a tag like <b:includable id=’post’ var=’post’>. This is the start of the section that will genrate the post-title, post-content, date-of-publishing, labels, etc. and similar miscellaneous information.
Now to add a “Tweet This” link to the each post use this code -
<a expr:href='"http://twitter.com/home?status=Now Reading -" +
data:post.title + " " + data:post.url' target="_new">
Tweet This
</a>
Depending up on where you are going to add that piece of code, you might have to add the necessary tags and define the properties. For eg. if you want the “Tweet this” link to be like the way its there at – http://jerryreghunadh.blogspot.com/ – this is the code that you need to add at the footer section :
<div class='post-footer-line post-footer-line-2'>
<span class='post-labels'>
<a expr:href='"http://twitter.com/home?status=Now Reading -" +
data:post.title + " " + data:post.url' target="_new">
Tweet This
</a>
</span>
</div>
Thats it. I guess this fixes the problem for you too