Thread

Multi Drop-down List

September 19, 2006 7:07pm

Subscribe [17]
  • #1 / Sep 19, 2006 7:07pm

    Mark Huot's avatar

    Mark Huot

    587 posts

    I’ve developed an extension that adds another field to the field types. The field acts the same as a “Drop-down List” however it allows you to select multiple items in the list. Add the extension like normal and modify your settings to control the display of the field in your template.

    Good Luck Mark

    Update 5 - Fixed a few bugs when using the pre-populate feature Update 4 - add the option “{input}” in the admin tab and the publish screen will now contain a text field for quick entries to the field Update 3 - fixed a bug where this extension would delete other fields data before the field got a change to parse it. Update 2 - added the ability to use separator=”[string]” in your template to override the default seperator Update 1 - updated extension to play nice with other extensions using the $EXT->last_call variable

  • #2 / Sep 20, 2006 4:34am

    Cocoaholic's avatar

    Cocoaholic

    445 posts

    Hi Mark,

    Excellent extension, I have been hoping for something like this for a while.

    2 things: - any particular reason you didn’t include “title” and “url_title” in the list of fields to choose from? - the link to your documentation shows an empty page.

    While you are at it, why not whip up some other field types as well? wink - a checkbox field - radio buttons

    I know it is possible to use drop-down select boxes and this extension to achieve the same result, but I’ve heard/seen some requests for it.

    Thanks

  • #3 / Sep 20, 2006 9:21am

    Mark Huot's avatar

    Mark Huot

    587 posts

    a few answers for you:

    I’m not sure what you mean by title, and url_title, but if you’re talking about pre-populating the field then that wasn’t me, that’s built into EE. I’m not really sure why you can’t pre-populate the field with a title or url title (I guess that’s the job of the relationship field)

    Yup, working on the documentation page now.

    As for the checkbox and radio buttons, I think the easiest way to do that would be with drop downs. Adding more custom fields seems redundant and just adds more development, debugging, and support for a process that is already possible with the current fields. One thing I will say, is that I’m going to publish a template for creating custom fields and with that you’re more than welcome to create checkbox and radio button fields.

    Thanks for the feedback, glad you liked the extension. mark

  • #4 / Sep 20, 2006 9:35am

    Cocoaholic's avatar

    Cocoaholic

    445 posts

    Yup, I was talking about the pre-populating of fields.

    Having the possibility to select multiple Titles would allow for some form of “one to many” relationship, especially if the “url_title” is passed to the template as well. Anyway, I see it works the way EE does, that’s cool.

    Again, drop-down fields don’t offer multiple selections, and that is what your extension was designed for right? So, if would be great to have it do checkboxes as well. (radio buttons don’t allow for multiple selections, my bad)

    Looking forward to this template you are talking about, very nice work!

    Cheers

  • #5 / Sep 20, 2006 9:44am

    Mark Huot's avatar

    Mark Huot

    587 posts

    I’m working on a multi-relationship field now, which will serve that “one-to-many” relation you are talking about, I think that’s a better way to go than to re-rig this. I’d like to keep everything pretty separate, there’s no reason for “one field to rule them all”.

    Here’s my take on the checkboxes and dropdowns: If you want to offer radio buttons then use a drop-down list (same idea, choose one out of many), if you want to offer checkboxes use a multi drop-down list (same idea, choose as many as you want). The reason for keeping them in drop-down’s is that when the field is posted all the values are stored in an array, however when you use checkboxes you would have to receive many values such as field_id_21_checkbox1, field_id_21_checkbox2, field_id_22_checkbox3. So I guess I’m saying that I’m too lazy to offer checkboxes, and I think the code would get fairly ugly and highly processor intensive, while the drop-down list’s keep it simple.

    You’re more than welcome to use my template however, when I post it, to create checkboxes, radio buttons etc.

  • #6 / Sep 21, 2006 1:57am

    james Brown's avatar

    james Brown

    492 posts

    I agree, if there was a way to allow someone to choose between the list typ (whch you have now) and a set of check boxes that would be so very useful. Although most of us have no problems using the control clicking method to select multiple items, our users can be a different story. Sadly many of the people I build sites for lack the mental ability to do this. But….they can do check boxes!

  • #7 / Sep 21, 2006 8:26am

    Mark Huot's avatar

    Mark Huot

    587 posts

    Hum…off to make a checkbox extension….

  • #8 / Sep 21, 2006 10:00am

    Robin Sowell's avatar

    Robin Sowell

    12716 posts

    There’s also a little cheat you can do with javascript - here- basically puts checkboxes inside the dropdown. Might play very well with this!

    (Though a line of checkboxes would be more ascetically pleasing- IMO.)

  • #9 / Sep 21, 2006 10:03am

    Mark Huot's avatar

    Mark Huot

    587 posts

    Yea, I’m going to work on the checkboxes extension and see how that ends up. If it’s a no go then this looks really promising.

  • #10 / Sep 22, 2006 11:13am

    Mark Huot's avatar

    Mark Huot

    587 posts

    I’ve posted a quick update to the multi drop down list extension above. It now plays nice with other extensions by using the $EXT->last_call variable. Download it in the first post.

  • #11 / Oct 03, 2006 10:35am

    Mark Huot's avatar

    Mark Huot

    587 posts

    Hello all. I did in fact create the checkbox extension that everyone has been talking about. Let me know how it works for you. One addition I see myself adding is a configurable number of columns, incase your labels are rather long.

    http://ellislab.com/forums/viewthread/38843/

  • #12 / Oct 05, 2006 11:53am

    Mark Huot's avatar

    Mark Huot

    587 posts

    Quick note: I’ve added the ability to define a separator in the template tag using separator=”[string]” where [string] can be whatever you’d like your separator to be.

  • #13 / Oct 05, 2006 12:42pm

    Daniel Walton's avatar

    Daniel Walton

    553 posts

    Yes, it is the job of the relationship field. At this time there is no multiple select for relationships though, would love to see title added to this extension smile

  • #14 / Oct 05, 2006 1:31pm

    Mark Huot's avatar

    Mark Huot

    587 posts

    Yes, it is the job of the relationship field. At this time there is no multiple select for relationships though, would love to see title added to this extension smile

    What is the job of the relationship field?

  • #15 / Oct 05, 2006 1:48pm

    Daniel Walton's avatar

    Daniel Walton

    553 posts

    This:

    # I’m not sure what you mean by title, and url_title, but if you’re talking about pre-populating the field then that wasn’t me, that’s built into EE. I’m not really sure why you can’t pre-populate the field with a title or url title (I guess that’s the job of the relationship field)

ExpressionEngine News

#eecms, #events, #releases