We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Multi Drop-down List

Development and Programming

Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

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

       
Cocoaholic's avatar
Cocoaholic
445 posts
18 years ago
Cocoaholic's avatar Cocoaholic

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? 😉 - 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

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

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

       
Cocoaholic's avatar
Cocoaholic
445 posts
18 years ago
Cocoaholic's avatar Cocoaholic

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

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

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.

       
james Brown's avatar
james Brown
492 posts
18 years ago
james Brown's avatar james Brown

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!

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

Hum…off to make a checkbox extension….

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
18 years ago
Robin Sowell's avatar Robin Sowell

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.)

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

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.

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

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.

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

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/

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

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.

       
Daniel Walton's avatar
Daniel Walton
553 posts
18 years ago
Daniel Walton's avatar Daniel Walton

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 😊

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot
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 😊

What is the job of the relationship field?

       
Daniel Walton's avatar
Daniel Walton
553 posts
18 years ago
Daniel Walton's avatar Daniel Walton

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)
       
1 2 3 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.