Sunday, November 26, 2006

Allow your labels to be searched in Technorati and Del.icio.us tags

Hello Friends,

I have developed a simple little add-on for your blog. To know what I am talking about, just see the labels in my post's footer. Notice the tiny Technorati pic beside each label. When clicked, it shows you all the posts from bloggosphere that have been tagged with the label in question. (See end of this post for Del.icio.us how-to)

It is a good way to allow your reader to search Technorati using tags and serves as a sort of "related posts from other blogs" link. Installing this code is fairly simple. Just follow these steps:

1. Edit your template HTML code and check the "Expand Widget Templates" box. Make a backup of your template if you are not used editing HTML.

2. Look for your post footer i.e. look for <div class='post-footer'>

3. Then in there, look for the labels code i.e. look for <span class='post-labels'>

4. In there, look for the main label href i.e. look for:

<a expr:href='data:label.url' rel='tag'><data:label.name/></a>

and immediately after that line add this code:


<a expr:href='"http://technorati.com/tag/" + data:label.name' rel='tag' target='_blank' title='Search this tag on Technorati'/><img alt='' border='0' src='http://photos1.blogger.com/x/blogger2/178/17688294081221/320/25365/technorati.gif' style='vertical-align:middle'/></a>


That's it! It's as simple as that. However, let me know if your face any problems.

Update: Del.icio.us How-to:

Deniz from imessengr.com has added the "search in Del.icio.us tags" functionality to labels, on similar lines. You can access the code from here.


Technorati Tags: , ,

20 comments:

protesto said...

Nice hack Vivek. You can use this icon if you want. It fits better.

http://static.technorati.com/static/css/img/icn/talkbubble.png

Anonymous said...

thanks man for such a great tip

Vivek Sanghi said...

@appu
You are welcome! thanks for stopping by!

Cyber-Buff said...

great hack buddy!!!!

protesto said...

Hi Vivek,

A little modification to your hack, searching for labels on the best known social bookmark manager del.icio.us:

<a expr:href='"http://del.icio.us/tag/" + data:label.name' rel='tag' target='_blank' title='Search this tag on del.icio.us'><img alt='d' border='0' src='http://photos1.blogger.com/x/blogger2/7669/739886498227135/200/158020/delicious.42px.gif' style='vertical-align:middle'/>
</a>

Vivek Sanghi said...

@cyber-buff
Thanks! :)

@Protesto

Gr8 idea! I am very happy with kind of varied use the label href code is being put to. First we have purpemoggy's label feeds, then my technorati search and now your del.icio.us search code.

I was wondering if all this can be combined and presented such that the label footers look neat and at the same time usability of these codes do not take a hit.

My idea is to have a drop-down such that by default the label name appears in the drop-down and when used the label feed, the technorati and del.icio.us links are available for use, but asthetically it may not look good and I want to avoid javascript coz it slows down my blog loading. You have any ideas?

protesto said...

You are right Vivek, asthetically it may not look good. Besides, there are many other bookmarking sites, so there is no limit for it. Actually I do not want to kick out my visitor from my blog by clicking other site's tags. So I think more than 3 tags are not so necessary.

Vivek Sanghi said...

Yeah agreed! Actually technorati, del.icio.us are enough and more needn't be added.

Singpolyma said...

If you wanted to have a whole list of things to search with each label you would probably use something similar to popmarks...

Vivek Sanghi said...

Hello Stephen. Popmarks like solution is perhaps the only way to keep the label footers neat. However, the original code will have to be redone for blogger beta.

dennyhalim.com said...

i guess you didnt read my blog :)
http://komputips.blogspot.com/2006/11/technorati-tags-on-blogger-beta.html

Vivek Sanghi said...

@DennyHalim.com

Similar stuff and published much before me. Nice Work! However, I smell sarcasm in your comment :D So I wish to state that I don't plagiarize for my hacks and always acknowledge the source where I should. Thanks for stopping by cheers!

FoxyTallChick said...

Nice hack guys. I've just implemented it on my site: here. Like you said - it can get a little bit unwiedly if you have a lot of tags so I'm just going to see it goes for a while before deciding whether to keep with it.

dennyhalim.com said...

sorry, never mean to be sarcasm. maybe because of my bad english...

i enjoy many of your posts and use some of them too.

Vivek Sanghi said...

@FoxyTallChick: Thanks for using my hacks. I hope we can improve it further. Cheers!

@DennyHalim.com: Hey! No probs! Glad to know that you use my hacks. Let me know if you post some thing gr8! and I will tell my readers about your blog. Cheers!

Shinichi said...

hi vivek i had a problem, it showing word linke this :
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The element type "b:loop" must be terminated by the matching end-tag "".

please give me a help
thx

Random J said...

Ditto. I am receiving the same error messages.

troublemaker be said...

yes i'm too. i can't to do this hack. the error say about end tag-b:loop. please, what we must do?

http://saveav.blogspot.com
http://blogywalkie.blogspot.com

Toinker said...

It's a good idea to put such code for your own blog. Thanks for posting this one dude.

Liberty said...

Same issue on my end as well. I know this is an older post, but I would like to know if there is a way to resolve this issue.

Other posts @ Stubborn Fanatic

Click here to view all my posts.

Creative Commons License
This work is licensed under a
Creative Commons Attribution-ShareAlike 2.5 License.

However, prior permission is required before you can display any content from this blog on your site. The author reserves the right to demand removal of such content at any time for any reason. (Not applicable for back-linking)
Note: The author is not responsible for any loss of data or damages to your homepage as a result of using the hacks suggested here. Please observe all necessary precautions while modifying template code.

© 2006 Vivek Sanghi a.k.a Stubborn-Fanatic