Show entity title after autocomplete selection instead of internal route (e.g., /node/123)

Created on 26 April 2018, over 6 years ago
Updated 21 May 2024, 6 months ago

Maybe for someone will be helpful such feature to show entity title instead of link in "Edit link" modal (see attached picture)

✨ Feature request
Status

Needs work

Version

7.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine semjuel

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

Comments & Activities

Not all content is available!

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

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Patch Failed to Apply
  • πŸ‡ͺπŸ‡ΈSpain marcoscano Barcelona, Spain

    Re-roll on top of 6.0.0

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update about 1 year ago
    Patch Failed to Apply
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    This feature request would seem to conflict with another feature request, ✨ Show URL alias after autocomplete selection instead of internal route (e.g., /node/123) Needs work .

    I think different people/audiences will have different opinions on which should be used; one problem with displaying the title for sites with a large amount of entities will be that the title is ambiguous -- it could be the same for multiple entities. The URL alias would not be ambiguous.

    In addition, the title of the entity *can* be seen during the autocomplete selection using this module's Suggestion Metadata, which allows for configurable tokens for each matcher.

    For those reasons, my judgment between these two feature requests is that ✨ Show URL alias after autocomplete selection instead of internal route (e.g., /node/123) Needs work would be preferable.

    I will not close this issue, as some users may still want to display the entity title in the input field after using the autocomplete, and can do so via community-provided patches. That said, at this time, I do not plan to add this to the module.

  • πŸ‡ͺπŸ‡ΈSpain marcoscano Barcelona, Spain

    Thank you @mark_fullmer for the feedback.
    I had a look at ✨ Show URL alias after autocomplete selection instead of internal route (e.g., /node/123) Needs work to see if it could be applied to our project, and unfortunately it doesn't meet our editors' current requirements (ie the alias isn't being saved in the markup, data attributes lost/removed, etc). Not sure if it's an issue with my setup or if I'm not testing things correctly, but for the time being, I'm just re-rolling the current patch on this issue. (I messed up with the re-roll in #9, this is a proper one against 6.0).

    Thanks!

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update about 1 year ago
    Patch Failed to Apply
  • We have tested and this patch is not working in ckeditor5 plugin. Can you please adapt this patch to be fully compatible with ckeditor5?

    thank you in advance

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    I had a look at ✨ Show URL alias after autocomplete selection instead of internal route (e.g., /node/123) Needs work ... unfortunately it doesn't meet our editors' current requirements (ie the alias isn't being saved in the markup, data attributes lost/removed, etc).

    Thanks for the clarification, @marcosano. I haven't actively been involved in development for that enhancement request, but what I'm hearing in your response is more that the latest patch has problems. What I'd like to know, first, from the users of Linkit, is whether there is more desire to display the entity title (this issue) or display the entity alias (issue #2877535).

    As a maintainer of the module, I'm in support of moving ahead with one of these options, but I don't relish the idea of making the choice between the two options available in the UI.

    I've already indicated that I think the alias would be more commonly desired, and that it avoids drawbacks of displaying the title, and have indicated how the title can already be seen:

    I think different people/audiences will have different opinions on which should be used; one problem with displaying the title for sites with a large amount of entities will be that the title is ambiguous -- it could be the same for multiple entities. The URL alias would not be ambiguous.

    In addition, the title of the entity *can* be seen during the autocomplete selection using this module's Suggestion Metadata, which allows for configurable tokens for each matcher.

    That said, I'm eminently open to hearing other perspectives!

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

    I want to see the alias within the link dialogue - for us, anyway, it's the most unique but also human-friendly way to know exactly which page I've selected.

    Outside the link dialogue, I'd want to see the title as the linked text, if I hadn't already selected different text to be linked, but that may be a whole different issue.

  • We need exactly the same as https://www.drupal.org/project/linkit/issues/2966320#comment-15253548 ✨ Show entity title after autocomplete selection instead of internal route (e.g., /node/123) Needs work . Example: node.title β†’

  • πŸ‡§πŸ‡ΎBelarus dakruchko

    There is a problem with rendering special characters (like single quotes for example) after applying patch #11. Here is a fix, maybe somebody needs

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.1 & MySQL 8
    last update about 1 year ago
    Patch Failed to Apply
  • πŸ‡ΊπŸ‡ΈUnited States brad.bulger

    Maybe make these choices configurable in the text format? I would add a suggestion to add a "link text" field or some better name. If the user has selected text in the field being edited, default to that, if not, maybe default to the entity title. Add a configuration option to choose the base path, the alias if exists, or the title as the default. This is very typical capability in text editors.

  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    Another vote for Kasey's comment #14 ✨ Show entity title after autocomplete selection instead of internal route (e.g., /node/123) Needs work , especially because acbramley's comment #5 ✨ Show entity title after autocomplete selection instead of internal route (e.g., /node/123) Needs work still holds five years later:

    While filtering showing the title is great, and showing the alias too when filtering is cool. But i can see the alias (or the entity canonical URL) in the href field of the edit link dialog anytime.

    But that fine title i could see while filtering?

    I cannot get that back. I have media/5 and have to try to remember the media name or filepath!

    So i agree with klidifia ✨ Display node title (a text) in by default when creating link in ckeditor5 Closed: duplicate that ✨ Display node title (a text) in by default when creating link in ckeditor5 Closed: duplicate should be re-opened, or this issue re-purposed and re-titled to distinguish the various needs:

    1. What is shown in the "Link URL" field when autocomplete is done? (For the record, i think that absolutely should be whatever is going to be in the final href, which perhaps should be consistently configured via URL Substitution, and should usually be the content alias, but would be the filepath for media when URL Substitution is so configured β†’ .)
    2. What is used for the link text, the words that are shown between the <a></a> tags, that can then be edited like other text in the WYSIWYG textarea.
    3. Would be great to be able to configure what metadata to stick in as the default title too, but that's definitely a different issue!

    Again, especially for the use case of media with URL Substitution for the filepath, having /media/5 be what is inserted into the document and linked is singularly not usefulβ€” it loses all the context that was available a moment ago when autocompleting the document to insert as a link.

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson
  • πŸ‡³πŸ‡ΏNew Zealand klidifia

    I updated this issue with some code that will use the entity title (already obtained via Linkit) as the default link text for a brand new inserted link without a selection range: ✨ Display node title (a text) in by default when creating link in ckeditor5 Closed: duplicate

Production build 0.71.5 2024