Add this cool tag cloud widget to your Blogger blog

Sunday, April 13, 2008

Tag cloud widget for blogger

The built-in Labels widget provided by Blogger is ok when you first start your blog. But after a while, the list starts to get too long and it makes for difficult viewing. I was having this problem with both my blogs, so I started searching for a good tag cloud widget that works with Blogger Layout. The best one I've found so far comes from a site called Frivolous Motion.

You can see the tag cloud in action on the top right-hand side of this blog. The screenshot above comes from my other blog, No Cost Software. It's easy to add this tag cloud widget to your Blogger blog - you can get the code, detailed instructions, a tutorial about tag clouds and a FAQ about tag clouds from this link at the Frivolous Motion site.

One bit of information I didn't find on the site was how to increase (or decrease) the font size. So I started experimenting with the widget code a bit and found a way to do this. Look for the line in the widget code that reads:

var size = 80 + (delta * 100) / (max - min);

This is the line of code that sets the font size of the tag to match the number of posts containing that tag - the more posts the bigger the font size. To increase or decrease the overall font size, just increase or decrease the value 80 (right after the equals sign, in bold) from the line above. Relatively small changes make quite a difference - the value I'm using for the tag cloud on this site as you see it now is 115. Have fun making clouds!