Hello,
The module works correctly for example with the plugin WebForm
However it does not work when I try to add a listType Field via ManageField (admin / structure / types / manage / article / fields)
Is this normal? So where did I forgot to set something?
Thanks in advance
Rod35

Comments

quicksketch’s picture

Title: Options Element and manage Field » Provide support for CCK/Field Select Lists, Radios, and Checkboxes
Category: task » feature

This module does not yet support CCK or the Field module in Drupal 7, though that is an obvious goal that I'd like to address eventually. I'll move this to a support request and this will become the official thread for progress on this front.

agence web coheractio’s picture

+1

2xe’s picture

+1 !

jenlampton’s picture

+1 :)

sea4’s picture

+1

TimelessDomain’s picture

this would make Prepopulate http://drupal.org/project/prepopulate much more powerful

alice-kahn’s picture

Title: Provide support for CCK/Field Select Lists, Radios, and Checkboxes » Support for images as option?

Hi,

I'm looking for a solution to add images as option values. Just like Yes/No, I want Image1/Image2.

Is this possible with this module or with any other module? Someone please help me with this?

Thanks

Alice

quicksketch’s picture

Title: Support for images as option? » Provide support for CCK/Field Select Lists, Radios, and Checkboxes

No, this module will not help setting images as options. You could enter in <img> tags manually as the values of course and that would work, but this module will not help you upload images for each option.

alice-kahn’s picture

But how can I do that? please give me a suggestion/sample?

Thanks

jenlampton’s picture

@alice-kahn this is the issue queue for the Options Element module. You are adding a comment on a specific issue against that module.

If you need advice on which module to use, please try the forums, groups.drupal.org, or IRC.

tnanek’s picture

+1

stan turyn’s picture

+1 (also hoping that adding CCK support will take care of Drupal Commerce fields too)

moertle’s picture

have a look to the core module "List". After enabling it, this elements are available.

Cheers

tnanek’s picture

@moertle

The defaults for select lists, radios and checkboxes are available after enabling the List module. But not the administrative interface added by this project, which is much more user friendly to the layperson when it comes to making a select list - it may work for Webforms (I don't know since I haven't needed to use Webform at all) but not on the Field API, which is what this particular issue is pertaining to; at least in Drupal 7 anyhow.

Hope that clarifies the issue some.

halefx’s picture

Quicksketch, could you add a note to the project description that this currently only works for Webform option fields?

kalabro’s picture

When I found this widget I was so happy — it's very handy for creating lists! Thank you, @quicksketch! I can't understand why it is not used by default in Drupal Field UI module.
Unfortunately there is no any patch for integration Options Element with Field UI. I started one. It's not perfect, but it works! :) I am willing to work hard to make this issue fixed.

  • Initial patch does work for List fields (float, integer, text)
  • Integrated for both field settings form and field instance settings form
  • Used core validation from 'list' module (list_allowed_values_setting_validate)
  • 'multiple' option works well with 'cardinality' element
  • Default values are saved correctly

How to test:
Apply the patch to branch 7.x-1.x, flush cache.

Any comments are welcome.

Update: see #18 for patch.

kalabro’s picture

Status: Active » Needs review
StatusFileSize
new5.58 KB

Oops! Some minor fixes.

kalabro’s picture

And one more :)
Only the latest patch should be tested.

quicksketch’s picture

Thanks @kalabro! I'd been wanting to incorporate options element support for Field module for quite some time. Thanks for the patch! I'll review it when I get the chance.

quicksketch’s picture

Title: Provide support for CCK/Field Select Lists, Radios, and Checkboxes » Provide support for Field Select Lists, Radios, and Checkboxes

Also, at this point I think it would wise of us just to handle Drupal 7 and not change out the interface on D6 users. Let's focus on the Field module. I *would* like to see options element in core, so this is a great step towards that goal.

kalabro’s picture

Status: Needs review » Needs work

Known problems:
When you change field cardinality from one to multiple, default values ​​are not saved for the first time. It is because Field UI default widget is not ready to take multiple values without page reload.

kalabro’s picture

The patch still works. Small fix with default values for field settings form.
About #21: I think it's not critical. For me, current state is pretty good.

webcultist’s picture

It worked for me very well, please commit this patch =)
Big thanks for this!

Sk8erPeter’s picture

kalabro, thank you very much, this seems to work great! :)

Here are some screenshots as a proof:

a regular List (text) field:

Options Element options_element-field-support-1057294-22.patch

editing List (text) field:

Options Element after options_element-field-support-1057294-22.patch

adding a new node:

Options Element after options_element-field-support-1057294-22.patch

kalabro’s picture

Thanks for review, guys!
@quicksketch, what do you think about it? Maybe we can add it to options_element-dev?

dave reid’s picture

I think it would be nice if we abstracted this one step further and had a way to convert a textarea with key|value pairs in it as text, into an options element. This would be useful not just here for the settings for select lists. Maybe a follow-up though.

naeluh’s picture

+1

dave reid’s picture

dave reid’s picture

Version: 7.x-1.4 » 7.x-1.8
Status: Reviewed & tested by the community » Needs review

Wrong link, see #1980868: Provide a reusable API to convert textarea fields to an options element.

Has this been manually tested with different 'Number of values' selected in the field? Unlimited? 2 or 3? Does it still work then?

kalabro’s picture

@Dave, should I convert patch from #22 to 7.x-1.8?
The only problem was #21 and I don't know how to fix it without modifying core field UI module :)

simon georges’s picture

Version: 7.x-1.8 » 7.x-1.x-dev

I suppose, as a feature request, it should go to the -dev version of the module (and bumping that, by the way).

mbenken’s picture

I am trying to use version 7.x-1.x-dev and having no luck. Have all the patches from above been committed to the latest dev version? I am using JQuery 1.5. I have installed/enabled the module, added a Select List field to a content type and I do not see what Sk8erPeter is seeing in #24. What am I not doing right?

Michael

kalabro’s picture

@mbenken, as you can see, last patch was submitted on November 13, 2012. Since that new version of Options Element was released. I don't plan to re-roll it again.
If someone is interested you are welcome!

mbenken’s picture

@kalabro, which version of the Options Element should I be using: 7.x-1.x-dev or 7.x-1.9?

kalabro’s picture

@mbenken all rerolls are usually done on latest dev: https://drupal.org/node/739080/git-instructions/7.x-1.x

KristineC’s picture

@mbenken did you figure it out? I installed 7.x-1.x and I also do not see the options element appear in a regular content type.

baysaa’s picture

Maybe it should be mentioned on the module description that this module works with Webform module only out of the box (non-dev versions)? It's a bit confusing otherwise. And linking to this issue for patches to make it work with CCK/Fields would be even better.

Options Element is a module that provides a better mechanism to specify select list, checkbox, and radio button options.

Should be

Options Element is a module that provides a better mechanism to specify select list, checkbox, and radio button options for Webform module's forms.

Or something or other.

quicksketch’s picture

Overall this looks like a great patch! The only concern I have reading through the overall code is that options_element.js probably shouldn't have JS specific to Field module in it. It'd be preferable for me if that was a separate JS file that was added only when editing a field (I know... another HTTP request for a really silly reason). Maybe we could make it a separate behavior at least? I'm just not keen on a very specific piece of JS being in our perfectly stand-alone JS.

Obviously this would go only into D7. Seems like a good opportunity to finally completely drop support for D6. Are we concerned about this change causing issues for modules that may be using the options area for things other than a piped list of values (i.e. using PHP code to assemble a list of options)?

quicksketch’s picture

Issue summary: View changes
Status: Needs review » Fixed
StatusFileSize
new5.89 KB

I revised this patch slightly with the following changes:

- Fixed minor merge conflict.
- Fixed coding standards in docs.
- Moved the Field-specific JS to a separate behavior.

All-in-all, great work! I decided for the time being we'll just continue with the 1.x branch as-is, so this will be in the 1.10 release. Thanks all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.