EllisLab text mark
Advanced Search
1 of 6
1
   
Multi Drop-down List
Posted: 19 September 2006 07:07 PM
Avatar
Joined: 2006-01-05
632 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

File Attachments
ext.multi_drop_down_list_111.zip  (File Size: 6KB - Downloads: 2864)
 Signature 
 
Posted: 20 September 2006 04:34 AM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2002-02-05
462 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

 
Posted: 20 September 2006 09:21 AM   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-05
632 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

 Signature 
 
Posted: 20 September 2006 09:35 AM   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2002-02-05
462 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

 
Posted: 20 September 2006 09:44 AM   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-05
632 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.

 Signature 
 
Posted: 21 September 2006 01:57 AM   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2005-08-31
654 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!

 
Posted: 21 September 2006 08:26 AM   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-05
632 posts

Hum…off to make a checkbox extension….

 Signature 
 
Posted: 21 September 2006 10:00 AM   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2002-05-20
12635 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.)

 Signature 
 
Posted: 21 September 2006 10:03 AM   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-05
632 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.

 Signature 
 
Posted: 22 September 2006 11:13 AM   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-05
632 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.

 Signature 
 
Posted: 03 October 2006 10:35 AM   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-05
632 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/

 Signature 
 
Posted: 05 October 2006 11:53 AM   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-05
632 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.

 Signature 
 
Posted: 05 October 2006 12:42 PM   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-22
575 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

 Signature 

(a.k.a the_butcher)

 
Posted: 05 October 2006 01:31 PM   [ # 13 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-05
632 posts
the_butcher - 05 October 2006 04:42 PM

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?

 Signature 
 
Posted: 05 October 2006 01:48 PM   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-22
575 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)

 Signature 

(a.k.a the_butcher)

 
Posted: 07 October 2006 03:05 PM   [ # 15 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-05
632 posts

Huh, thanks.

 Signature 
 
1 of 6
1