Allow customize of Link field subfields title text in Link field Widget (LinkWidget)

Created on 20 June 2022, over 3 years ago
Updated 13 February 2023, almost 3 years ago

Problem/Motivation

Very often the "Link" field type is used to not display a regular html link, but to represent a Button with some action, or to store link to some resource (eg anchor, local file, some custom internal path).

And in that cases the hard-coded titles "URL" and "Link text" of the widget does not always suite, because link in that cases will not be displayed as link, but as some designed widget, and the action could be not the "jumping to the filled url".

But now we can't override the text of subfields titles, we can only add placeholders to the fields.

Steps to reproduce

Try to create a "field_action_button" Link field to represent a button, with "Name" as the title of the "url" subfield, and "Action" as the "title" subfield title.

It isn't possible to do without making a lot of hooks (two hooks per each entity bundle - for "add" and "edit" forms, plus additional hooks for "Inline Entity Form" subforms), or hooking the widget type, or creating a custom widget.

Proposed resolution

Allow setting the titles for the subfields in Link Widget settings.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Feature request
Status

Needs work

Version

10.1

Component
Link 

Last updated 4 months ago

Created by

🇦🇲Armenia murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024