Daniel’s DropDowns 1.0 – WordPress Plug-In

I’ve created a plug-in that I’m now using on my personal site to provide the category and archive drop-down lists. It’s called “Daniel’s DropDowns”, and it will create drop-downs with either a link or a button to go to the selection in the drop-down, and a CSS class can be specified for the button and the drop-down box.

daniels_dropdowns.txt – Daniel’s DropDowns 1.0

To install it, download the file, rename it “daniels_dropdowns.php”, and upload it to your /wp-content/plugins directory. Then, enable it, and add the template tags to your theme. (The documentation at the top of the file lists all the template tags provided, and the options that can be passed to them.)

9 Comments »

  1. Soilcoins.Com » Daniel’s DropDowns 1.0 - WordPress Plug-In said,

    October 2, 2007 at 10:25 pm

    [...] wrote an interesting post today on Danielâ

  2. negative said,

    December 23, 2007 at 12:41 pm

    is there any chance avoid the button/link?

  3. Daniel said,

    December 23, 2007 at 1:15 pm

    There is, but not with the plug-in. (Well, at least the way it’s currently coded.) I wrote the plug-in because the template tags seemed to produce the automatic-change-when-selected type of lists. Personally, I don’t care for those (the reasons why I’ll elaborate on in a minute). I could have sworn that the old template tags did that by default – of course, that was a while back, and they changed category template tags in version 2.1. On WordPress’s Codex, they have an example of an auto-navigation archive list. It shouldn’t be too tough to do – would you like that as a feature?

    As to why I don’t like auto-navigating select boxes… First, you can’t really use them if you don’t use a mouse. If you tab to the field and push the down-arrow, you get navigated to the next item on the list. Second, if you click on one by mistake, you have to make sure you select the one that was selected, or you get navigated away. A third, but now nearly moot point, was that in IE 6, if you had the select box as the focused element on a web page, and scrolled the mouse wheel, it scrolled the select box instead of the web page. IE 7 and Firefox don’t do that, and those are the browsers I use most of the time.

  4. negative said,

    December 23, 2007 at 9:47 pm

    At first, thank you for your quick response! didn’t expect that quick :)
    second, if you could do that, like it’s on WP Codex page with archives, that would be great. When I found that yesterday, I have tried to code similar peace of code for categories, but no luck.

    I agree with you that it’s hard to navigate without mouse, but I don’t know anyone who doesn’t use mouse while browsing.. I think mouse is the most popular part of PC/laptop – after monitor/screen and keyboard :)

  5. Daniel said,

    December 23, 2007 at 10:30 pm

    Well, you happened to catch me when I was at the computer. :)

    I’ve been playing with it this evening, and I believe I’ve got a version that will do what you’re looking for. I’m wrapping up the “what’s changed” stuff in the readme.txt file, and then I’ll commit it to the WordPress plug-in directory. Version 2.0 is the new one – the parameters will be a bit different, but passing ‘auto’ as the first one will create the auto-navigating select boxes. Thanks for asking the question – I actually found a bug while I was going back over the code!

    I have a mouse – sometimes, though, I don’t use a mouse. However, I used to work with a group of mainframe guys who were keyboard junkies. :) And, since, at the time, I was responsible for making pages that they used, I made sure they worked.

  6. Daniel said,

    December 23, 2007 at 11:03 pm

    Wow – that was quick. I uploaded it, did a few things, then went back to my personal blog and it told me there was a new version! :) Let me know if that works for you.

  7. negative said,

    December 23, 2007 at 11:38 pm

    Works like a charm! :) Thank you so much!

    Actually, I made some changes already – deleted all styling from plugin – I will style everything in my css file. :)

    Now I’m thinking about one more thing – how to put empty option first for categories drop-down, like it is for archives drop-down. And it will be perfect.. It will be the same like I would make if I could :)

  8. Daniel said,

    December 24, 2007 at 8:45 am

    Oops! I didn’t think about that – there’s no way to navigate to the first category. I’ll take a look at that – that one’s a little more complex, but as long as WordPress renders it the same way every time, it still shouldn’t be too hard. That’ll be 2.0.1 when it’s released.

  9. negative said,

    December 24, 2007 at 12:05 pm

    looking forward to see version 2.0.1! :)

    by the way, merry Christmas! ;)

RSS feed for comments on this post · TrackBack URL

Leave a Comment