Wednesday, August 18, 2010

Converting Labels to Drop Down

Simple way to convert the Labels in a blog to drop down menu
1. Goto Design -> Edit HTML
2. Make sure Expand Widget Templates check-box is not selected
3. Search for following line
<b:widget id='Label1' locked='false' title='Labels' type='Label'>
4. Replace the above line with following content
<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'>
<select onchange='location=this.options[this.selectedIndex].value;'>
   <option>Choose a label</option>
   <b:loop values='data:labels' var='label'>
      <option expr:value='data:label.url'><data:label.name/>
         (<data:label.count/>)
      </option>
   </b:loop>
</select>
 </div>
</b:includable>
</b:widget>


5. Click on SAVE TEMPLATE button to save the changes made.
6. Click the View Blog option to verify.

                                                                                                                    ***For More info Click

No comments:

Post a Comment