Problem/Motivation
Followup from issue #3541876: Allow collapsing / expanding of multivalue items:
Furthermore it would be nice if we could optionally select a (text) property of the custom_field field that functions as the details label, instead of
Item (1), Item (2), etc...
Proposed resolution
- In the form widget settings, add an optional setting to select the property whose value should be used as the details wrapper label
- This setting is only shown when the "Details" wrapper is selected
- The setting shows a select list of properties available on that custom_field field - probably only string values should be in that list
- If selected, some Javascript code should be added to the widget form, which copies the text from the selected property and uses it as details label. When the text of the selected property changes in the form, the details label should be updated. The text should probably be sanitized and have a maximum length set (if too long, append "..." at the end?)
Issue fork custom_field-3556431
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
svendecabooterComment #4
svendecabooterComment #7
apmsooner commentedComment #9
svendecabooterTested the improvements with a few fields on my local install, and this does seem to work nicely.
Thanks for the updates and quick commit.
Comment #10
apmsooner commented