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?)

Command icon 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

svendecabooter created an issue. See original summary.

svendecabooter’s picture

Status: Active » Needs work

svendecabooter’s picture

Status: Needs work » Needs review

apmsooner made their first commit to this issue’s fork.

apmsooner’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

svendecabooter’s picture

Tested the improvements with a few fields on my local install, and this does seem to work nicely.
Thanks for the updates and quick commit.

apmsooner’s picture

Status: Fixed » Closed (fixed)