Problem/Motivation

Hello,

In certain configurations and for some site builders there may be a need to have a label for a field that differs when the field has more than one item. For example 'Topics' and 'Topic'. As field_label allows a site builder to change the label of a field at its discretion, it would be interesting to leverage this functionality and accommodate the case described above by including it in this module.

Proposed resolution

Add new settings and check field cardinality and field items count and replace custom label.

User interface changes

Add a new 'Plural label' field third party setting and 'Plural label enabled' toggler on Field Label Configuration form.

Data model changes

field.formatter.third_party.field_label and field_label.settings schema should be updated. Since new setting is set 'false' by default, current field configuration shouldn't be affected.

Cheers!

CommentFileSizeAuthor
#3 3416747-3.patch6.74 KBjoao.ramos.costa
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

joao.ramos.costa created an issue. See original summary.

joao.ramos.costa’s picture

StatusFileSize
new6.74 KB

Heŕe is a patch from the current MR.

justcaldwell’s picture

Status: Active » Needs review

Hello @joao.ramos.costa.

Wow, what a great idea -- thanks for the contribution! I'll try to get this reviewed in the next couple of days.

Thanks again.

joao.ramos.costa’s picture

Hi @justcaldwell,

Thank you ! :)

justcaldwell’s picture

Status: Needs review » Fixed

Great implementation. Merged with new release to follow shortly.

Thanks again for the contribution! 🙏

joao.ramos.costa’s picture

Super! Thanks a lot!

João.

Status: Fixed » Closed (fixed)

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