How to Make Drop-Down Labels Menu in Blogger?

If you host your blog on the Blogger (blogspot) platform, and you have significant number of labels on your sidebar, you might be looking for a suitable solution to show them, but also save the expensive space for other elements. These two tasks can be achieved by using the option of displaying your labels in a simple drop-down menu. Many bloggers already use drop-down option for long lists of labels (categories), which minimizes clutter and enables information to be displayed in the sidebar neatly.

While Blogger offers a dropdown menu option for the Archives widget, you will not be able to find an option to do the same for your labels. In this post, we will review two ways you can use to convert your regular Label list into a drop-down list.

Method 1

1. Template Backup. As usual, when you just think about making any changes to the template code, it is strongly recommended to make a complete back up of your existing template. This ensures you can easily roll back and restore your current, working template if you make any mistake.

To make a back up of your current template, go to Layout > Edit HTML in your Blogger dashboard and click the “Download Full Template” link near the top of the page. This will offer the option to save your current Blogger template as an XML file to your local computer. Be sure to save this file in a location you can easily find later.

2. Ensure you have a “Labels” widget in your Blogger template. If you do not have a Labels widget activated in your template, go to Layout>Page Elements and add a Labels widget using the “Add a Gadget” link above your sidebar. Definitely, your posts should be labeled as well to transfer the related content to the activated widget.

3. Go to Layout > Edit HTML in your Blogger dashboard. This time, DO NOT check the "Expand Widget Templates" checkbox!

4. Search for the following code (note that the name of the label in your template might be slightly different):

5. Replace the above code, with this:

6. Modifying the Widget. To alter the phrase “Choose a label to view” which is visible when the drop down menu is contracted, you will need to go to the Layout>Edit HTML page of your Blogger dashboard and check the “Expand widget templates” box. Then search for this phrase in your template code. Simply alter the wording of this phrase to something more suitable for your blog, being careful not to alter any of the surrounding code.

To clarify, here is the line of code where adjustments will be made. The text which can be altered is highlighted in red:


No matter, which method you choose, at the end of the performed modification save the template and back it up with a new name. Do not overwrite the backup file you created at the beginning, since you want to try the option for some time and decide you do not see any problems or performance drawbacks.

Sources and Additional Information:

site visitor