- Issue created by @skyriter
- last update
over 1 year 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 alison
After discussion with other developers on the project, I opted to not completely replace the default help text but to concatenate it field's help text to it, both to have consistency with the help text across all Linkit widgets on a given site and to minimally affect existing fields.
I think this β¬οΈ is a good plan, also because it's how help text works on fields that use the core LinkWidget. On my fields that use the core LinkWidget, the resulting help text is actually an unordered list -- perhaps, for UX consistency (and the simplicity of just, using an established pattern from Drupal Core), we could do that with Linkit-enabled link fields?
π Here's how core + user-provided help text is put together for the core LinkWidget: https://git.drupalcode.org/project/drupal/-/blob/b57dbb43806a5434c7f7400...And here's an example of the resulting help text markup (from one of my link fields that uses core LinkWidget) -- the first list item is my custom help text, the second list item is provided by Core:
<div id="edit-field-card-slider-slides-0-inline-entity-form-field-slide-link-0-uri--description" class="form-item__description"> <div class="item-list"> <ul> <li>If filled in, the <em>slide title</em> will be a clickable link.</li> <li>Start typing the title of a piece of content to select it. You can also enter an internal path such as <em class="placeholder">/node/add</em> or an external URL such as <em class="placeholder">https://example.com</em>. Enter <em class="placeholder"><front></em> to link to the front page. Enter <em class="placeholder"><nolink></em> to display link text only. Enter <em class="placeholder"><button></em> to display keyboard-accessible link text only.</li> </ul> </div> </div>
Re: #7 -- makes sense. I suppose it's out of scope for this issue, but I don't feel strongly about forcing a new issue, except that there's always a chance the added scope makes the resolution take longer -- but, I don't feel strongly about it.
π For reference, here's where that description text is set in core.