Apologies if this is a duplicate...
Based upon the work done by quickstetch's options_element project, I created a patch for D7. This patch adds a new form element, 'options', and a host of helper functions.
This patch seems to work okay, though I haven't changed any parts of core to take advantage of the functionality yet. Left todo are:
1) Find places in core to use this
2) Figure out where to put the css file (currently it's added to /misc/ directory along with the js file)
3) Write tests
For reference, see:
#740396: Core patch?
http://drupal.org/project/options_element
Comment | File | Size | Author |
---|---|---|---|
#11 | options_elements.patch | 18.63 KB | bcn |
#11 | options-element.js_.txt | 24.64 KB | bcn |
#11 | options-element.css_.txt | 1.66 KB | bcn |
#11 | add.png | 259 bytes | bcn |
#11 | delete.png | 609 bytes | bcn |
Comments
Comment #1
bcn CreditAttribution: bcn commentedScreen shot..
Comment #2
yoroy CreditAttribution: yoroy commentedNice. tagging & subscribe.
Comment #3
bcn CreditAttribution: bcn commentedScreenshot of the other form state.
Again, this is all Nate's work, I mainly just copied and pasted from there to here.
Comment #4
amc CreditAttribution: amc commentedSeems like we should find a use case for this before it gets put into core. No need to add UI elements that we aren't using anywhere...
Please reopen this issue if there's general agreement on a particular place where this pattern is useful.
Comment #5
tstoecklerEhhh, this is in core.
Try adding a 'List' field to a content type. You will have to enter a list of allowed values in a weird "key|value" pair. Then apply this patch (and clear cache).
The question is rather, whether this is still possible for D7.
Comment #6
amc CreditAttribution: amc commentedAh. Now I see where it could be used. Not sure if this is the best UI for it, though.
Comment #7
amc CreditAttribution: amc commentedcorrecting tag
Comment #8
Bojhan CreditAttribution: Bojhan commentedThis should have a Seven theme on the background. and a in context example.
Comment #9
yched CreditAttribution: yched commentedThis would indeed be an ideal UI for the 'list' field types.
[edit: hm, except that the 'Default' checkboxes wouldn't fit in this use case. In Field API / Field UI, default values are configured in a different place]
Comment #10
bcn CreditAttribution: bcn commentedNot really.. The patch doesn't actually change anything in core to make use of the new element. So in a practical sense, it's unlikely that there's time to get this into d7.
List module does seem like the obvious candidate, but there's a good deal of changes necessary to move away from the textarea & key|value method.
@Bojan Attached are some screen's with Seven, in a potential (but not yet coded) context..
Comment #11
bcn CreditAttribution: bcn commentedUpdated patch to latest code from options element module...
This patch also includes a dirty hack to the list module to test the options element.
Also note that I couldn't figure out how to get new files added to this patch, so they're attached (with an extra .txt extension) here and need to be dropped in the misc directory.
Comment #12
bcn CreditAttribution: bcn commentedforgot to change status... Needs work for the changes that need to happen in list.module
Comment #13
fizk CreditAttribution: fizk commentedWhat's the progress with this issue?
Comment #14
Bojhan CreditAttribution: Bojhan commentedI wonder too, I would still like this going in.
Comment #15
Simon Georges CreditAttribution: Simon Georges commentedI suppose it's too late now that Feature Freeze has happened, isn't it?