Sunday, August 17, 2008

How to show labels (tags) in your blog?

When I recently created my blog in blogger, I had no way of showing my labels in the blog. I searched all over the internet trying to find a way to show the labels. Every search result suggested me to use "Add a page element" link to add the Labels option. But there was no such link when I tried to customize my blog. Trust me, I wasted almost 5 hours searching just to find out how to make the "Add a page element" link show up on my customization page. But I was never successful in doing so.


But I found another way to show the Labels instead of wasting my time to get the "Add a page element" to show up.

The following code will show all the labels used in your blog.

<b:widget id='Label2' locked='false' title='YOURTITLE' 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>


You can find more information at http://www.consumingexperience.com/

Please post in your comments and suggestions.

No comments: