This widget is perfect for blogspot users who desire a simple tag cloud for their Categories. The Labels Cloud can easily be implemented within the sidebar of your blog and will match your template wonderfully.
Steps for Implementation
Step 1: Back it Up
Always make sure to back up your Blogger Template before doing anything else!
Step 2: The Labels Gadget
Always make sure to back up your Blogger Template before doing anything else!
Step 2: The Labels Gadget
Make sure that you have the Labels Page Element installed. If you haven't already...
- Go to Layout >Page Elements .
- Click "Add a Gadget" and then add the "Labels" gadget.
Step 3: Locating the "Old Code"
- Now go to Layout >Edit HTML
- Make sure that the "Expand Widgets Template" box is unchecked.
- Now we need to search for the code that looks like this.Your code may look a little different. So try using your browser's search tool to find type='Label'.
1<b:widgetid='Label1'locked='false'title='Tags'type='Label'/>
- Once you've located type='Label', remove the whole line of code that looks just like the code mentioned in part 3 of step 3.
- Replace this code that you've just deleted with the code below:
01<b:widgetid='Label1'locked='false'title='Tags'type='Label'>02<b:includableid='main'>03<b:ifcond='data:title'>04<h2><data:title/>h2>05b:if>06<divclass='widget-content'style='text-align: justify;'>07<scripttype='text/javascript'>08/*09Simple Blogger Tag Cloud Widget10by Raymond May Jr.12Released to the Public Domain13*/1415//Settings / Variables16var max = 150; //max css size (in percent)17var min = 70; //min css size (in percent)18var showCount = false; // show counts? true for yes, false for no19var minCount = 1; // what is the minimum count for a tag to be shown? 1 for all202122//Begin code:23var range = max - min;2425//Build label Array26var labels = new Array();27<b:loopvalues='data:labels'var='label'>28labels.push("<data:label.name/>");29b:loop>3031//URLs32var urls = new Array();33<b:loopvalues='data:labels'var='label'>34urls.push("<data:label.url/>");35b:loop>3637//Counts38var counts = new Array();39<b:loopvalues='data:labels'var='label'>40counts.push("<data:label.count/>");41b:loop>4243//Number sort funtion (high to low)44function sortNumber(a, b)45{46return b - a;47}4849//Make an independant copy of counts for sorting50var sorted = counts.slice();5152//Find the largest tag count53var most = sorted.sort(sortNumber)[0];5455//Begin HTML output56for (x in labels)57{58if(x != "peek" && x != "forEach" && counts[x] >= minCount)59{60//Calculate textSize61var textSize = min + Math.floor((counts[x]/most) * range);62//Show counts?63if(showCount)64{65var count = "(" + counts[x] + ")";66}else{67var count = "";68}69//Output70document.write("<spanstyle='font-size:" + textSize + "%'><ahref='" + urls[x] + "'style='text-decoration:none;'>" + labels[x] + count + "a>span> " );71}72}73script>747576<spanstyle="font-size:80%;float:right;">Powered by <ahref="http://www.widgetsforfree.blogspot.com">Blogger Widgetsa>span>77div>78b:includable>79b:widget>
Step 5: Previewing the New Tag Cloud
Before saving the template make sure to click preview. The new tag cloud should now be visible. If not, make sure that you've completed all the steps correctly.
0 comments:
Post a Comment