Tuesday

Adding a Drop down Labels menu

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 'Ctr
l' + 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



Digg Technorati del.icio.us Stumbleupon Reddit
feedburner

Every New lesson , directly to your Mail Box .....

2 comments:

Khalilur Rahman on July 21, 2012 at 7:12 AM said...

Rich blog, I should say it is all tricks in one place. Easy, tricky and anybody can get more flexibility to use these article without having any difficulties. 

Irfan Sattar said...

Thanks for sharing
this great Post dude


SEO
Company bangalore

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

The Word Validation image has been removed and no need to Sign In. So don't be lazy ..........

 
This blog sucks under Internet Explorer.

Buy me a Coffee


Powered By

Latest Site News


Animated 3D Dock removed in order to speed up loading time and to help IE users.

This site will be come up with a DOMAIN name soon.

Link and Win competition will start as soon as the Domain name added. Join with us. You could be the winner.

Site Info

since 2009 April

Vote

Vote to My site to be nominated for Best Geek Blog!

Submit a Lesson

Visitors

of Visitors read Pages.

Lessons by DragonD | Template by Simran | Logo by lahirulcd | Temaplate redesigned by DragonD| Icons by DryIcons.com | Licensed under CC license Creative Commons License