Drop-down Menu for Labels in Blogger

Written by EarnBlogger on December 14, 2007 Posted in: Blogger

You have a blog in Blogger platform and you want to show your huge list of labels in a drop-down menu. Then, this Blogger hack is just for you! With a simple modification in your template, you can add a cool drop-down menu for your labels. This is helpful for you, if you have created lots of labels for your blog posts. Read on.

 

blogger-labels.jpg

 

How to add a Drop-down Menu for Blogger Labels?

 

  • First thing first. Always backup your existing template before making any changes. You can do it by clicking on “Download Full Template” link in the “Template>Edit HTML” section of your blog.
  • After the backup, look for “Expand Widget Templates” in the same section i.e., “Edit HTML” section. Check it to expand your template.
  • Now find the following code in your template:

<b:widget id=’Label1′ locked=’false’ title=’Labels’ type=’Label’>

  • To find this code, press ‘Ctrl+F’ in Firefox. A ‘Find’ box will appear at the bottom of your browser. Enter the above code into the search box and hit ‘Next’. This will automatically locate your code and highlight it.
  • In some custom templates, the above code may be different. In that case, search <b:widget id=’Label1′
  • Look below the highlighted code and after 6-7 lines you will see the <ul> tag. Select all the codes between <ul> and </ul> (hardly 10-12 lines) and delete them.
  • Now in that space paste the following code:

<br />
<select onchange=’location=this.options[this.selectedIndex].value;’>
<option>Select 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>

  • Almost done. Click the ‘Preview‘ button, below your template editor. If you are going as per instructions, you will see a drop-down menu in your labels section. If anything goes wrong, click ‘Clear Edits‘ button and do it again. Once done, save your template.

So far, 4 responses to “Drop-down Menu for Labels in Blogger”. Add your own!

  1. Stereotype says:

    XML error message: Open quote is expected for attribute “{1}” associated with an element type “onchange”.

  2. EarnBlogger says:

    Stereotype, can you tell me what exactly happened? This is a simple code done by Hackosphere. It should not create problem.

  3. NoodleGei says:

    Change the () in without the ().

  4. henry says:

    ya its very useful

Leave a Reply