Here is a short description of how to embedding a labelcloud into blogger ...
The originally script was written by phydeaux3 and modified by ... i just wrote this post to try how the syntaxhighlighter works you'll find more informations regarding this topic here (phydeaux3 &
1) CSS. Goes anywhere between the tags b:skin and /b:skin, preferably right before the end tag
- /* Label Cloud Styles
- ----------------------------------------------- */
- #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:"" !important}
2) Widget. Goes anywhere between b:section id="'sidebar'" and /b:section (replacing the first b:widget id="'Label1'" ... line)
- <b:widget id="'Label1'" locked="'false'" title="'Label" type="'Label'">
- <b:includable id="'main'">
- <b:if cond="'data:title'">
- </b:if></b:includable></b:widget><h2><data:title></data:title></h2>
- <div class="'widget-content'">
- <div id="'labelCloud'"> <ul>
- <b:loop values="'data:labels'" var="'label'">
- <li>
- <b:if cond="'data:blog.url">
- <data:label.name>
- <b:else>
- <a href="http://www.blogger.com/%27data:label.url%27"><data:label.name></data:label.name></a>
- </b:else>
- (<data:label.count>)
- </data:label.count></data:label.name></b:if></li>
- </b:loop>
- </ul></div>
- <script type="'text/javascript'">
- <b>// Label Cloud User Variables
- var maxFontSize = 20;
- var maxColor = [168,181,248];
- var minFontSize = 8;
- var minColor = [0,0,0];
- var lcShowCount = false;
- var minPostCount = 0; //integer</b>
- // Don't change anything past this point -----------------
- 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 ta=0;
- var c=[];
- var labelCount = new Array();
- var ts = new Object;
- <b:loop values="'data:labels'" var="'label'">
- <b:if cond="'data:label.count'">
- if (<data:label.count/> > minPostCount) ts["<data:label.name/>"] = <data:label.count/>;</b:if></b:loop>
- for (t in ts){
- if (!labelCount[ts[t]]){
- labelCount[ts[t]] = new Array(ts[t])
- }
- }
- tz = labelCount.length-1;
- lc2 = document.getElementById('labelCloud');
- lc2.innerHTML = '';
- ul = document.createElement('ul');
- ul.className = 'label-cloud';
- for(var t in ts){
- 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>
- <b:include name="'quickedit'/">
- </b:include></div>
regarding to internet explorer 6, there is a js-problem (illegal statement) but the script works fine with Safari&FF - i'll chase the problem when i find some motivation - sorry
Problem solved - here you can find what to do
Read more...