My new blog

My blog has moved to www.davehunter.co.uk/blog see you there.

Thursday 5 July 2007

Are your labels getting out of hand?

If you use http://www.blogger.com/ and the label widget you may find that you have too many links displayed under the labels section ... I did.

There aren't any properties to restrict how many links appear. After looking through the html of the template, you can add an if clause to only show labels if they appear more than once. You will need to find the label widget with the HTML of the template and add the lines hightlighted.

<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'">
<b:if cond="'data:label.count > 1">
<li>
<b:if cond="'data:blog.url">
<data:label.name/>
<b:else/>
<a href="'data:label.url'"><data:label.name/></a>
</b:if> (<data:label.count/>) </li>
</b:if>
</b:loop>
</ul>
<b:include name="'quickedit'/"> </div>
</b:includable>
</b:widget>


You will need to replace ">" within the if statement with the HTML character code. Also increase 1 if you want to show labels with more than 3, 4, 5, 6 ... for example.

No comments: