Tutorials For Beginner

Wednesday, September 3, 2008

Making Tag / Label Cloud in New Blogger Template

Update : This tutorial is no longer compatible, please read the latest tutorial, click here!
label-cloud_03 Hello, Friends, today is Ramadhan Month, I would like to say sorry if I have some mistakes to you and I have forgiven your mistakes too. In this beautiful day, I would like to try to respond one question that many friends have asked to Kang Rohman, the question is about how to make Tag / Label Cloud in New Blogger Template (xml).

In order to make a label cloud, I will use the technique of phydeaux. Before reading and applying this tutorial, make sure that you have added label element in your blog. Before doing this one, make sure that your blog uses a Label. Ok my friends, here are the steps;

 

  1. Sign in into blogger
  2. Click Layout menu
  3. Click Edit HTML tab
  4. Click Download Full Template, and then save the data to back up if you make mistakes in editing the template code.
  5. Click Expand Widget Templates to give a check.

     

    expand-widget_thumb

  6. Wait the process for a few second
  7. Save the following code between <b:skin><![CDATA[ and
    ]]></b:skin> or if you are still confused, just save the code right above ]]></b:skin>.

     

     

     

  8. Copy and Paste the following code after ]]></b:skin> and before </head> or if you are still confused, just save right above </head>.

  9. Find the following code in your template

     

    <b:widget id='Label1' locked='false' title='Labels' type='Label'>
    <b:includable id='main'>
    <b:if cond='data:title'>
    
    <h2><data:title/></h2>
    </b:if>
    <div class='widget-content'>
    <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>

    <b:include name='quickedit'/>
    </div>
    </b:includable>
    </b:widget>

     

     

  10. Change the code above with the code below.

     



    
    <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'/>
    <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&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('labelCloud');
    ul = document.createElement('ul');
    ul.className = 'label-cloud';
    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('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>


     

     

  11. Click SAVE TEMPLATES button
  12. Finish

 

Good luck my friends.

Save and Share!

Stumble Digg Tweet Save Reddit More

45 Comments:

Syamsul Alam on September 3, 2008 9:55 AM said...

Pertamax.... why there's no example of this label cloud, huh? It makes me feel doubt to use it or not.

rohman on September 3, 2008 11:13 AM said...

for the example of label cloud, you can see my banner at the left top of this article.

DS. Utomo on September 3, 2008 1:06 PM said...

Please send me your tutorial about how to break down a post and continue reading on another page. Thanks a lot,

rohman on September 3, 2008 5:04 PM said...

Please read my posting Here!

panduan bisnis online on September 3, 2008 8:55 PM said...

ada tag cloud label yang lebih keren mas

coba lihat di blog http://yourlife-bisnisonline.blogspot.com

ce_sexy on September 4, 2008 12:56 PM said...

thansk you.......
my site

awan-clickerz on September 5, 2008 10:49 PM said...

wah,.sukses..makasih yakang...semoga jaya selalu...
salam persaHabatan fren2...

Rafiq Raja on September 9, 2008 9:33 PM said...

Thanks that worked perfectly as expected.

girishg on September 23, 2008 8:54 PM said...

re

Casuarina on November 10, 2008 10:44 PM said...

Thank you so much !!!

Trauma Junkie on November 21, 2008 4:14 AM said...

Worked great! See my blog.

Fusion! on December 18, 2008 4:52 AM said...

How do I change the color?

The Cuties' Mommy on January 1, 2009 1:11 AM said...

Perfect directions!! Thanks!! And...I am definitely NOT a guru on the computer.

c james. on January 15, 2009 1:36 AM said...

wow! this worked as explained. I've tried to edit the HTML using other label cloud widgets and the instructions were just too complex. Thanks for keeping it simple for us newbies to HTML.

Ricardo on January 26, 2009 6:13 AM said...

i can't get it to center the cloud.. it's always to the left. i'm using k2 template..

Ex-Expat on January 27, 2009 4:27 AM said...

Awesome tutorial! Thank you so much!

I found one issue where the label cloud could not seem to override my Blogger template settings, so it appeared left-aligned with a serif font. To fix this I changed one line from:

#labelCloud .label-cloud {}

to:

#labelCloud .label-cloud {text-align:center;font-family:arial,sans-serif;}

Then everything worked perfectly. Thanks again for this great tutorial!

Jen on January 29, 2009 7:30 AM said...

How do I change the color of the links?

Karl Zada on March 3, 2009 7:12 PM said...

Hi there Rohman. I have been trying to apply your tutorial since I really love the to cloud my post or that "continue to read" thingy but I am having a problem with Step 9.

I am not really into this so can you please help me? In step 9, if you are asking to find that script exactly, it doesn't appear in my html.

I would appreciate if you can reply.

Rohman on March 3, 2009 8:17 PM said...

Hello Karl,

make sure that you have added label widget in your blog. Before doing this one, make sure that your blog uses a Label.

livewp on March 7, 2009 2:16 PM said...

I wanted to thank you for your tutorial on making a Tag Cloud. You made it so easy!!

Karl Zada on March 7, 2009 3:19 PM said...

Hi Rohman, I did add the label widget in my blog but to no avail. What do you think is the problem. I really need this one. It's cool

Anonymous said...

this is perfect. no error or whatsoever. this is what i wanted. thank you so much for sharing.

BiketoWork Barb on March 28, 2009 10:48 AM said...

Worked great for me too! See www.biketoworkbarb.blogspot.com.

However, like another commenter above I would really like to know how to apply the same rules for link & text colors as the rest of the blog design. That would make this perfect.

I also figured out how to edit the header that sits above the tag cloud.

Look for this text inside brackets:
b:widget id='Label1' locked='false' title='Label Cloud' type='Label'/

Replace words Label Cloud with the words you want as your header. On mine, it's 'What I write about'.

@BarbChamberlain

Suresh on March 28, 2009 11:17 AM said...

It is a very good tutorial and working very fine and thank you for sharing.

I have a small issue with this.
May be because my blog design the labels are appearing only one per line and taking a lot of space at the right side bar. Request help from you and would like to know how can i get this labels side by side.

Here is the problem at my blog

http://abapreports.blogspot.com

Waiting for the reply and thank you once again.

adeska on March 28, 2009 8:00 PM said...

Thank you so much for this tutorial.. :)

EcoDevPro on March 29, 2009 1:06 AM said...

Thank you. Worked perfect.

___4.n.n.4___ on April 3, 2009 9:16 AM said...

tq. it works for me

Afiqah Azlee on April 7, 2009 9:00 PM said...

it comes out as the tittle of my page.
how do i make it come out on the left side of my page? look here. www.rockingsheepishly.blogspot.com

birdy on April 10, 2009 9:45 PM said...

Thanks for sharing, but it doesn't work for me. I want to see my labels like your example. However in my blog I see one label per line as in default template.

Pk-photography

Russ said...

Thank you very much! This worked perfectly.

Raghu Menon on April 17, 2009 7:03 PM said...

It works. Thanks.

Anna-Maria on April 19, 2009 4:22 AM said...

i just wanted to thank you for such a good tutorial! i'm not skilled at all when it comes to computerstuff, but the tag-cloud worked at the first try!
..now i'm just wondering how to change the blue colour, but i guess i can't have it all.. :D
thanks again!

chillone on May 4, 2009 5:59 PM said...
This post has been removed by the author.
chillone on May 4, 2009 5:59 PM said...

bagi bagi

it's possible to have a label cloud and a label drop down list together?

thanks for advance

http://the-sun-rise-in-the-east.blogspot.com/

si ConTrenG on May 10, 2009 10:56 PM said...

cloud gw kok jelek bentuknya
memanjang hehehe

si ConTrenG on May 10, 2009 10:58 PM said...

g jd gw pasang deh

Dark Poetess on May 14, 2009 10:23 PM said...

was brilliant, even though I couldn't find the label widget to insert beforehand. thanks so much!

Jinal on June 5, 2009 12:28 AM said...

This works like a charm. Thanks for posting such a useful and clearly explained information

http://cookingfunfood.blogspot.com

Jinal on June 5, 2009 12:51 AM said...

Does anyone know how to change the color of the font? Please help because blue is not matching with my blog.

Suresh on July 24, 2009 9:53 AM said...

Thanq Rohman for your valuable tutorials.I've applied the code for label cloud but it is not working in IE6.It is working perfectly in Mozilla.Please help me.

Viktor on July 30, 2009 2:18 AM said...

Not working for me. Tried it twice to no avail.

Beben on October 21, 2009 7:52 AM said...

kalo trik kek gini banyak yg gagal. Coba tuntunnya macam ginih deh kang. Add gadget yg type label, suruh kasih judul (bebas). Nah entar suruh cari judulnya tersebut. Baru pada ngeuh kali kang kalo diginiin. Soalnya pd yg nyari pas di centang...malah cari yg udah ada, padahalkan hrs add gadget type label dolo LoL. Kalo komentnyah gak berkenan del ajah kang. Maaf gak bisa inggris...xixixix

Online Entertainment on October 28, 2009 4:46 PM said...

Hi
It is really nice.
but now some time ago it is not work on my computer. can u check ?
it is work on your computer ?

ame on November 12, 2009 6:44 AM said...

Thanks for your tutorial :) IT work nicely on my blog

pharmajobs on March 9, 2010 7:16 PM said...

dear friend your tutorial good but about lable cloud your good where the u r top left TUTORIALS FOR BEGINNER is fine plz tell me how to insert ?
http://pharmajobsindia.blogspot.com


Post a Comment

Please comment in English.

Spam Comment will be delete!

 

Recent Comments