Label (Tags) Cloud Widget for TypoXP Blogger
This feature will give you a label (tags) cloud widget for your TypoXP Blogger sidebar.
Step#1
Goto the Template>Page Elements page, make sure you have a label widget already installed where you want it (it can be moved around
later).
Step#2
Go to Template>Edit HTML. Leave the Expand Widget Templates box UNCHECKED (default).
Scroll down and find your Label Widget code in your template. Will look something like this.<b:widget id='Label1' locked='false' title='Labels' type='Label'/>
Copy the following code, then highlight the label widget as shown and replace it with a paste.<b:widget id='Label1' locked='false' title='Tags' type='Label'>
<b:includable id='main'>
<b:if cond='data:title'>
<div id="icon-tags"><h2><data:title/></h2></div>
</b:if>
<div class='widget-content'>
<div id='labelCloud'/>
<script type='text/javascript'>
// Don't change anything past this point -----------------
// Cloud function s() ripped from del.icio.us
function s(a,b,i,x){
if(a>b){
var m=(a-b)/Math.log(x),v=a-Math.floor(Math.log(i)*m)
}
else{
var m=(b-a)/Math.log(x),v=Math.floor(Math.log(i)*m+a)
}
return v
}
var c=[];
var labelCount = new Array();
var ts = new Object;
<b:loop values='data:labels' var='label'>
var theName = "<data:label.name/>";
ts[theName] = <data:label.count/>;
</b:loop>
for (t in ts){
if (!labelCount[ts[t]]){
labelCount[ts[t]] = new Array(ts[t])
}
}
var ta=cloudMin-1;
tz = labelCount.length - cloudMin;
lc2 = document.getElementById('labelCloud');
ul = document.createElement('ul');
ul.className = 'label-cloud';
for(var t in ts){
if(ts[t] < cloudMin){
continue;
}
for (var i=0;3 > i;i++) {
c[i]=s(minColor[i],maxColor[i],ts[t]-ta,tz)
}
var fs = s(minFontSize,maxFontSize,ts[t]-ta,tz);
li = document.createElement('li');
li.style.fontSize = fs+'px';
li.style.lineHeight = '1';
a = document.createElement('a');
a.title = ts[t]+' Posts in '+t;
a.style.color = 'rgb('+c[0]+','+c[1]+','+c[2]+')';
a.href = '/search/label/'+encodeURIComponent(t);
if (lcShowCount){
span = document.createElement('span');
span.innerHTML = '('+ts[t]+') ';
span.className = 'label-count';
a.appendChild(document.createTextNode(t));
li.appendChild(a);
li.appendChild(span);
}
else {
a.appendChild(document.createTextNode(t));
li.appendChild(a);
}
ul.appendChild(li);
abnk = document.createTextNode(' ');
ul.appendChild(abnk);
}
lc2.appendChild(ul);
</script>
<noscript>
<ul>
<b:loop values='data:labels' var='label'>
<li>
<b:if cond='data:blog.url == data:label.url'>
<data:label.name/>
<b:else/>
<a expr:href='data:label.url'><data:label.name/></a>
</b:if>
(<data:label.count/>)
</li>
</b:loop>
</ul>
</noscript>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>
Save the widget. Then try it out.
Thanks to phydeaux3. For more explanation, please read information here.
July 17, 2007 at 9:29 PM
kk saya ini br bikin blog jd saya masih harus banyak belajar. yang mau saya tanyakan ama kamu, pas saya upload blognya lalu ada konfirmasi berhasil. setelah itu saya klik link LIHAT BLOG. tapi kok blognya masih yang asli ya?
July 22, 2007 at 10:57 AM
I really like the TypoXP-Theme for Blogger. I wanted to add the Label-Cloud, but it always says "The content of elements must consist of well-formed character data or markup." and won't save - any suggestions?
Martin
mail@m-storbeck.de
July 22, 2007 at 11:05 AM
Finally took this one (which should be the same) and it worked ...:
phy3blog.googlepages.com/Beta-Blogger-Label-Cloud.html
August 4, 2007 at 10:40 PM
It's working..its showing me some error.Please help me out.
August 4, 2007 at 10:41 PM
whoops i mean its not working..showing me some error..pls help
August 11, 2007 at 11:19 PM
koq aku gak bisa ya bikin label (tags) kayak gini, padahal dah ngikutin petunjuk :(