Monday, January 12, 2009

Tag Cloud for Blogger

I have come to enjoy the tag cloud on my SQLServerCentral blog and was wondering if I could do that at Blogger as well. Tags and clouds are so popular I was sure that there would be a widget already there to do this, but alas I didn't see one in the search.

So I Google'd and found this one from phydeaux3. I was a little worried about adding the code to my blog, but I decided to use one that I don't depend on, give it a try, preview, all the testing I could from a remote place and it worked great.

I had to futz with it a bit, especially as it seems the directions are a little sparse. Here's what I did:

Go to the Layout, shown here:


Now click the "Add a gadget" item on your layout (it may be on the left or right).



Then add a Labels element to your page.




Click the plus and it will add it. First you get the chance to edit it. I set mine for frequency and then renamed it.



This will hold the place for the tag cloud.



Put the first set of code from the link above BEFORE the line so it looks like this:



Next you need to put the script code, which doesn't want to render here, AFTER the line, but before the head:



You can get the code from the link above.

Lastly you need to find the label widget in the code. It should be near the bottom.



Highlight the line I've shown here and paste in the third set of code from the link above in it's place. It should go from the b:widget to the /b:widget sections.



That's it, preview it and you should see a cloud like the one I have to the right.

No comments: