Tutorials, tips and tricks about Blogger

07 Jul

QuickT :: How to show only labels with more than X posts!

2 Comments | by in Features, Tips and Tricks, Tutorials, Widgets | 2009

Español Português

1. Go to Layout> Edit HTML and do NOT check the “Expand widget templates” box:

2. Look for this line of code:

<b:widget id='Label1' locked='false' title='Labels' type='Label'/>

3. Replace it with the following code:


<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 &gt; 2'>
    <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:if>
</b:loop>
</ul>
  <b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>

4. In the first line highlighted in red, you decide the minimum number of posts a label needs to have in order to be displayed in your Labels’ widget/gadget.

🙂

Comments

2 Comments, leave a reply · Feed
  1. Great, I used this tip on my blog and was very good, thanks.

  2. hey! Let’s say a post has 2 labels, can we say to blogger, to show up on the footer, only the one label, and specify which one of the two?

Reply

You must be logged in to post a comment.

Tutorials, tips and tricks about Blogger