gadget/widget bloggerSobat sudah pada kenal tentunya dengan widget tags yang ada di blogspot! Secara dasar tagging widget sendiri ditandai dengan kode <b:widget> Basic gadget berjumlah 26 buah, gadget dari pengembang pihak ke tiga 874 biji (Data tertulis, Feb/03/2013) dan customize gadget (
Lebih jelas keterangan mengenai widget tags silahkan sobat satroni link berikut Blogger Help Koben akan memberi contoh trik & teknik melakukan snippet/modifikasi/hack LABELS gadget blog.
ScreenshotTampilan labels dibagi menjadi dua jenis yaitu: list and cloud.
Gaya List | Gaya Cloud |
---|---|
Hack | Snippet |
---|---|
Setelah itu lihat kode template [
<b:widget id='Label1' locked='false' title='Labels' type='Label'>
Hapus code tersebut dan gantikan dengan kode berikut...Hack List Labels<b:widget id='Label1' locked='false' mobile='yes' title='KATEGORI' type='Label'>
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>
<div class='widget-content'>
<ul>
<script type="text/javascript">
var root = "<data:blog.homepageUrl/>";
var tagUrl = "search/label/";
var labels = new Array();
<b: loop values='data: labels' var='label'>
labels.push("<data: label.name/>");
</b: loop>
i=labels.length;
while(i > 0)
{
i=i-1;
document.write("<li><a href='"+root+tagUrl+labels[i]+"'>"+labels[i]+"</a></li>");
}
</script>
</ul>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>
Cloud Labels Snippet<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>
<div class='widget-content'>
<ul>
<script type="text/javascript">
var root = "<data:blog.homepageUrl/>";
var tagUrl = "search/label/";
var labels = new Array();
<b: loop values='data: labels' var='label'>
labels.push("<data: label.name/>");
</b: loop>
i=labels.length;
while(i > 0)
{
i=i-1;
document.write("<li><a href='"+root+tagUrl+labels[i]+"'>"+labels[i]+"</a></li>");
}
</script>
</ul>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>
<b:widget id='Label1' locked='false' mobile='yes' title='KATEGORI' type='Label'>
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>
<div class='widget-content' style='text-align: justify;'>
<script type='text/javascript'>
var max = 150;
var min = 70;
var showCount = false;
var minCount = 1;
var range = max - min;
var labels = new Array();
<b: loop values='data: labels' var='label'>
labels.push("<data: label.name/>" );
</b: loop>
var urls = new Array();
<b: loop values='data: labels' var='label'>
urls.push("<data: label.url/>" );
</b: loop>
var counts = new Array();
<b: loop values='data: labels' var='label'>
counts.push("<data: label.count/>" );
</b: loop>
function sortNumber(a, b)
{
return b - a;
}
var sorted = counts.slice();
var most = sorted.sort(sortNumber)[0];
for (x in labels)
{
if(x != "peek" && x != "forEach" && counts[x] >= minCount)
{
var textSize = min + Math.floor((counts[x]/most) * range);
if(showCount)
{
var count = "(" + counts[x] + " )";
}else{
var count = "";
}
document.write("<span style='font-size:" + textSize + "%'><a href='" + urls[x] + "' style='text-decoration:none;'>" + labels[x] + count + "</a></span> " );
}
}
</script>
</div>
</b:includable>
</b:widget>
Kalau bumbu tidak jalan mungkin karena ada yg gue maju²in karena bentrok dengan emotikon. Silahkan kunjungi link resource sumber :D<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>
<div class='widget-content' style='text-align: justify;'>
<script type='text/javascript'>
var max = 150;
var min = 70;
var showCount = false;
var minCount = 1;
var range = max - min;
var labels = new Array();
<b: loop values='data: labels' var='label'>
labels.push("<data: label.name/>" );
</b: loop>
var urls = new Array();
<b: loop values='data: labels' var='label'>
urls.push("<data: label.url/>" );
</b: loop>
var counts = new Array();
<b: loop values='data: labels' var='label'>
counts.push("<data: label.count/>" );
</b: loop>
function sortNumber(a, b)
{
return b - a;
}
var sorted = counts.slice();
var most = sorted.sort(sortNumber)[0];
for (x in labels)
{
if(x != "peek" && x != "forEach" && counts[x] >= minCount)
{
var textSize = min + Math.floor((counts[x]/most) * range);
if(showCount)
{
var count = "(" + counts[x] + " )";
}else{
var count = "";
}
document.write("<span style='font-size:" + textSize + "%'><a href='" + urls[x] + "' style='text-decoration:none;'>" + labels[x] + count + "</a></span> " );
}
}
</script>
</div>
</b:includable>
</b:widget>
Resource:
How To Sort The Labels Widget Reverse Alphabetically
A Simple Blogger Tag Cloud Widget
Happy labels \m/
Tidak ada komentar:
Posting Komentar