Cmb2: Is it possible to have a select multiple?

Created on 6 Aug 2015  Â·  9Comments  Â·  Source: CMB2/CMB2

I was wondering why select multiple are not supported. I think that "multicheckbox" could work for a few options but what about with many options? Could it be possible to have something like select2 for multiple options which allows to filter options by writting down the name of the option.

Feature Request Field Types

Most helpful comment

@slaFFik I'd prefer the latter, a field parameter, but we already use multiple as a field parameter to determine if it should be repeatable. So let's just go ahead and make it a new field type. That helps with back-compat concerns as well.

All 9 comments

I also need a multiple select box. I have cmb-field-select2 installed, which is great for some purposes, but for this field I need a normal select so I can include a tree-like list of the site's pages. The hierarchy needs to be visible. For the same reason, checkboxes won't work. I can add 'multiple' to the attributes, so the interface is good, but there doesn't seem to be an option to make sure every selected option is saved.

Hi, any idea about this? It's actually pretty crucial for a project I'm working on. I'm sure someone familiar with the plugin could tweak things quickly. If that's not going to happen, I'll have to look into it myself, or use another plugin (seems a bit much to switch such a crucial aspect of a project for something that should be standard). At least, could you point me in the right direction to make this change and submit a pull request? Cheers.

More of a bugfix I'd say - why would a multiple select not store all the values selected? Anyway, any idea of how long this might take? Would be great if someone who knows the code could hit the proverbial right nail, but if it'll take a while I'll roll my sleeves up and have a go so we can be on course with our project.

@jtsternberg
What do you think, should it be a new separate field type select_multiple, or "just" add support to a current select as requested in #995?

@slaFFik I'd prefer the latter, a field parameter, but we already use multiple as a field parameter to determine if it should be repeatable. So let's just go ahead and make it a new field type. That helps with back-compat concerns as well.

I would very much like select and taxonomy_select to have a multiple parameter.

I'm assuming you saw https://github.com/CMB2/CMB2/wiki/Field-Types#taxonomy_multicheck and it's not meeting what you're hoping for, in this case. Correct?

Yes — I'm using taxonomy_multicheck now. It takes up too much screen space. That makes sense if you have, say 6 options, but not if you have 15.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gorirrajoe picture gorirrajoe  Â·  4Comments

noquierouser picture noquierouser  Â·  8Comments

djob195 picture djob195  Â·  4Comments

GaryJones picture GaryJones  Â·  3Comments

jquimera picture jquimera  Â·  8Comments