Friday, January 11, 2008

Creating Dropdown Menu Bar

I have been wanting to post this cool blogger hacks for a while, but due to my busy daily routines I haven't found time to really post it. But now because there are two people who ask about it, I decide it to give it a try. This hack was originally created by Alastor in his blog, you can read his full guide to make this hack works here. All credits must go to him, as I was just using it in my other blog. There is also another hack to show recent post in the dropdown menu, which was made by Vivek Singh. You can find all the details here. Now, I didn't just use it as it is, because I was not satisfied by listing all my categories in the dropdown menu (which can be many categories). So I did a little hacking by myself to limit the number of categories you want in your drop down menu. I have tested here in my blog and it worked. If you want to try, feel free to give it a try but don't forget to back up your template first. If something goes wrong, you can always revert to your old template.
I based my hack on Alastor's. All the steps required are the same as his. But I replace the code in his post in the "a) Categories in the Menubar:", with this code here.
This code is used to limit the number of categories to 10, if you want to have more just replace the number 10 in "if (labelnum++ < 10)" to whatever number you want. Remember there are two lines which are using the number "10", be sure to replace both of them. Ok, there you go your dropdown menu is ready to be tested. If you have any questions feel free to leave it at the comment section of this post or just shout in the shout box. If you want to see the look of the dropdown menu bar I've created, click here. Cheers!

1 comment:

The Adventures of MYK JONES said...

This original site (http://non-alastor.blogspot.com/) is blocked. Can anyone show me the original drop down menu instructions?