How To Add A Drop Down Labels Menu in Blogger


Labels , they help the reader to find posts under specific category. But , if you are using a single column template or if you are having too many labels , it may be a big problem for you. So , that's why programmers had invented some thing called the Drop Down Menu. Lets add one of it to our blog too.



1. Edit your Template
2. Now find out



<b:loop values='data:labels' var='label'>


( press 'Ctrl' + F to open your browser's search box)

Now you will find a set of code lines similar to following



<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>

Now replace above whole code set with the following codes


<select onchange='location=this.options[this.selectedIndex].value;' style='width:100%'>
<option>Browse By Labels( Name you want to display as drop down menu's caption )</option>
<b:loop values='data:labels' var='label'>
<option expr:value='data:label.url'><data:label.name/>
(<data:label.count/>)
</option>
</b:loop>
</select>



Now follow the Safety Saving Steps.

And


How To Add A Drop Down Labels Menu in Blogger How To Add A Drop Down Labels Menu in Blogger Reviewed by Ruchi on August 08, 2019 Rating: 5

No comments:

Powered by Blogger.