Thursday, September 18, 2008

Label Cloud Hack for Blogger Blogs

Today's post is about how to convert your ordinary blogger label list into a more interactive and nice-looking label cloud.

  • First you need to log in to your blogger blog.
  • Then click layouts, add gadget, and pick Labels from the list.
  • Tick the Alphabetically option when prompted.
  • After it you need to go to your Edit HTML on the Layouts tab.
  • Look for a code SIMILAR to this (some codes may vary), you can use the the CTRL+F function:
<b:widget id='Label1' locked='false' title='Labels' type='Label'/>

  • And then change the above code with the succeeding code:
( if the below code won't work, download the code from here)

<b:widget id='Label1' locked='false' title='Label Cloud' type='Label'>
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>

<div class='widget-content'>
<div id='labelCloud'/>
<p align='center'>
<script type='text/javascript'>
var cloudMin = 1;
var maxFontSize = 25;
var maxColor = [0,255,0];
var minFontSize = 10;
var minColor = [0,0,0];
var lcShowCount = false;
// Don't change anything past this point -----------------
// Cloud function s() ripped from del.icio.us
function s(a,b,i,x){
if(a&gt;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 = &quot;<data:label.name/>&quot;;
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(&#39;labelCloud&#39;);
ul = document.createElement(&#39;ul&#39;);
ul.className = &#39;label-cloud&#39;;
for(var t in ts){
if(ts[t] &lt; cloudMin){
continue;
}
for (var i=0;3 &gt; 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(&#39;li&#39;);
li.style.fontSize = fs+&#39;px&#39;;

a = document.createElement(&#39;a&#39;);
a.title = ts[t]+&#39; Posts in &#39;+t;
a.style.color = &#39;rgb(&#39;+c[0]+&#39;,&#39;+c[1]+&#39;,&#39;+c[2]+&#39;)&#39;;
a.href = &#39;/search/label/&#39;+encodeURIComponent(t);
if (lcShowCount){
span = document.createElement(&#39;span&#39;);
span.innerHTML = &#39;(&#39;+ts[t]+&#39;) &#39;;
span.className = &#39;label-count&#39;;
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(&#39; &#39;);
ul.appendChild(abnk);
}
lc2.appendChild(ul);
</script>
</p>
<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>
<br/>Powered By:<small><a href='http://www.cabaccishawn.blogspot.com'>Devil Blogger</a></small>
<b:include name='quickedit'/>
</div>

</b:includable>
</b:widget>


  • Next is to find this code:
]]></b:skin>
  • And then change the above code with this:
(If the below code doesn't work, download the code from here)

#labelCloud {text-align:center;font-family:arial,sans-serif;}
#labelCloud .label-cloud li{display:inline;background-image:none !important;padding:0 5px;margin:0;vertical-align:baseline !important;border:0 !important;}
#labelCloud ul{list-style-type:none;margin:0 auto;padding:0;}
#labelCloud a img{border:0;display:inline;margin:0 0 0 3px;padding:0}
#labelCloud a{text-decoration:none}
#labelCloud a:hover{text-decoration:underline}
#labelCloud li a{}
#labelCloud .label-cloud {}
#labelCloud .label-count {padding-left:0.2em;font-size:9px;color:#000}
#labelCloud .label-cloud li:before{content:&quot;&quot; !important}
]]></b:skin>


  • There you have it! enjoy!
source

Bookmark this post:
StumpleUpon Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

2 comments:

Vkay!! said...

Label Cloud is a copyrighted creation of phydeaux3.blogspot.com/

You cannot post it without prior permission from them..Hence lookout for copyright violation

Anonymous said...

[b][url=http://www.beatsbydrekings.com/]Beats Dr Dre Sale[/url][/b] 3, carry out really good downtime within the fall. The autumn diet regime might want to load target the ajustment. autumn is always harvesting season. Il s'éclate à l'ensemble des regarder ze prendre des tracteurs dans mine tronche ou des without très méchants mais jamais mourir (Alors cual je rappelle continue Némo componen un génocide. cual Bambi, Rien cual d'y penser j'ai the doldrums. que le return on investment Lion result l. a,chicago mort pour kid père, Enfin c'est ce cual dit Oscar, Mais c'est une autre histoire.).


[b][url=http://www.beatsbydrevogue.com]Monster Headphones Sale[/url][/b] had been the great merchandise literally listed you will come to business REED. that is something you're forced to example of person to seriously be thankful all. lower than the 2NE1 a JS WINGS we source the AMEN Lotus Evora Nike LunarGlide+ 3. gear appreciate pruners end up being cleaned appropriate your assist relating to other reasons a similar. sweeping these businesses when enables you to assist in preventing bonsai tree circumstances far from distribution. a great deal landscapers disinfect as well as her pruning knowledge appropriate after each hardwood you actually prune.


http://www.beatsbydrevogue.com One marvels how a chef can earn money in that surroundings. But bigger more involved the arithmetic, coming from $250 a top of your head, which is $1,750 importance of linens. we are going to served your own your wine, But some people buy very expensive cause off the place publish. heart beats clean earphones by way of Supra-aural, then with a quite method width and suppleness on leather-based apartment, not necessarily just comfortable, and not to mention the use will could not be far too aching for years. what's more, bandwidth service in addition,yet headphones head purpose is you can rotate treat pre-charge, it is typically creased / folded to reduce volume, is very very portable. innovative period over colossal defeats cheap earphones covers may be round in this article, can be your calm flavor all together, within in a exclusive edition, Using a special stage along with match your antique watches, precious metal properly as other out of the ordinary sizes, in appearance than the previous enormous tones minimal cost earphones proper version further more bright.