Use the field's help text when set

Created on 9 February 2024, 10 months ago
Updated 16 May 2024, 6 months ago

Problem/Motivation

Our UX designers have recommendations for links that are specific to our site. They want those recommendations to show between the Link field label and the field itself in the form display. The problem is the that the link help text is hard-coded in the module in this file: linkit/src/Plugin/Field/FieldWidget/LinkitWidget.php to read: "Start typing to find content or paste a URL and click on the suggestion below."

Proposed resolution

One solution would be to use the field help text if it exists and to use the hardcoded text as a fall-back.

✨ Feature request
Status

Active

Version

7.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States skyriter

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

Merge Requests

Comments & Activities

  • Issue created by @skyriter
  • πŸ‡ΊπŸ‡ΈUnited States skyriter
  • πŸ‡ΊπŸ‡ΈUnited States skyriter
  • Merge request !38Concatenate the field help text β†’ (Open) created by skyriter
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.2.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update 10 months ago
    82 pass, 2 fail
  • πŸ‡ΊπŸ‡ΈUnited States skyriter

    After discussion with other developers on the project, I opted to not completely replace the help text but to concatenate it, both to have consistency with the help test across all Linkit widgets and to minimally affect existing fields.

  • πŸ‡ΊπŸ‡ΈUnited States davidmpickett

    This seems like a good compromise. An additional enhancement to communicate this novel behavior to Site Builders might be to add some explanatory text to the Widget settings. Maybe something like:

    Help text for URL field
    The following default help text will be displayed for the URL field. "Start typing to find content or paste a URL and click on the suggestion below."
    If you add your own help text in the field settings, it will display after the default help text.

    This could be inserted between the Placeholder for URL and Placeholder for link text.

  • πŸ‡©πŸ‡ͺGermany mrshowerman Munich

    Let me add another aspect to the discussion:
    I wonder why Linkit's widget uses a fixed help text for all cases, in contrast to Core's LinkWidget, which has 3 different help texts, depending on the link type setting (internal links only, external links only, internal and external links allowed).

    "Start typing to find content" doesn't really make sense when only external links are allowed; same goes for "paste a URL" with internal links only.

    Not sure if this is the right place for that addition, or we should create a separate issue.

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson
Production build 0.71.5 2024