This simple tricks is based on changing the Label Gadget settings. So the first step of course, you must already have to use or instal the Label Gadget in your blog.
If you have not install yet, then: Go to your Dashboard >> Layout >> Add a Gadget >> Choose Label and name it, ex: Blogger New Tips Label.
Note: Please choose/click the List Display
The next step is to change the display setting of our Label, by modidying the HTML Label Code.
Go to Layout >> Edit HTML >> and check your Expand Widget Template (Don't forget to backup your template first).
Search and find your Label codes, the easiest way is to find your "Label name", use ctrl+F to find it (Blogger New Tips Label).
You will find similar code like this:
<b:widget id='Label1' locked='false' title='New Blogger Tips Labels' type='Label'>To make a drop-down list label, just replace the red script with this blue one
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>
<div expr:class='"widget-content " data:display "-label-widget-content"'>
<b:if cond='data:display == "list"'>
<ul>
<b:loop values='data:labels' var='label'>
<li>
<b:if cond='data:blog.url == data:label.url'>
<span expr:dir='data:blog.languageDirection'><data:label.name/></span>
<b:else/>
<a expr:dir='data:blog.languageDirection' expr:href='data:label.url'><data:label.name/></a>
</b:if>
<b:if cond='data:showFreqNumbers'>
<span dir='ltr'>(<data:label.count/>)</span>
</b:if>
</li>
</b:loop>
</ul>
<b:else/>
<b:loop values='data:labels' var='label'>
<span expr:class='"label-size label-size-" data:label.cssSize'>
<b:if cond='data:blog.url == data:label.url'>
<span expr:dir='data:blog.languageDirection'><data:label.name/></span>
<b:else/>
<a expr:dir='data:blog.languageDirection' expr:href='data:label.url'><data:label.name/></a>
</b:if>
<b:if cond='data:showFreqNumbers'>
<span class='label-count' dir='ltr'>(<data:label.count/>)</span>
</b:if>
</span>
</b:loop>
</b:if>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>
<select onchange='location=this.options[this.selectedIndex].value;'>So the final script will be like this:
<option>Choose The Label</option>
<b:loop values='data:labels' var='label'>
<option expr:value='data:label.url'><data:label.name/></option>
</b:loop>
</select>
<b:widget id='Label1' locked='false' title='New Blogger Tips Labels' type='Label'>And will be displayed like this:
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>
<div expr:class='"widget-content " data:display "-label-widget-content"'>
<b:if cond='data:display == "list"'>
<select onchange='location=this.options[this.selectedIndex].value;'>
<option>Choose The Label</option>
<b:loop values='data:labels' var='label'>
<option expr:value='data:label.url'><data:label.name/></option>
</b:loop>
</select>
<b:else/>
<b:loop values='data:labels' var='label'>
<span expr:class='"label-size label-size-" data:label.cssSize'>
<b:if cond='data:blog.url == data:label.url'>
<span expr:dir='data:blog.languageDirection'><data:label.name/></span>
<b:else/>
That's all... Enjoy to make a dropdown list label menu...
0 comments
Post a Comment