Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291237

UX: Hide entity ID in autocomplete widget

$
0
0

When using an autocomplete widget, Drupal adds the entityID in brackets after the entity name. The entityID is unique, but the text label for that entity may not be, so adding the ID ensures the user will choose the "right" thing and that the "right" thing gets passed back to Drupal.

 Dutch (318), English (270), Yolnu (352)

People often ask why this number in brackets is here, or wonder what it means, or assume it's something else. Some people ask for it to be removed. This has happened to me on four different projects, and now I search for it, it would seem I'm not alone.

"users on my site have been asking me what the number in brackets mean and getting confused by it." - joachim 5 Oct 2012

"I would be very interested in this as I am worried the [nid: 34] style appendage might be unfriendly for some users, and it certainly seems like we need a different solution." - danielb 17 Oct 2008

"one problem for my users is that they are not in the habit of seeing node/entity ID's, so this number in parentheses is confusing when they see it in the autocomplete list of suggested matches." - lucyp 9 Dec 2014

Shall we see if we can fix it?

It seems like such a little thing, but it adds up over time, and it's poor UX from core, with many contrib attempts to work around it.

Proposed resolution & workarounds:

  1. Hide it with JavaScript
  2. Use views instead
  3. Change the value display to be more descriptive, like: "Term name [ID: 123]" instead of "Term name (123)" (see #40)
  4. Use one of these modules:

Core issues

* #322383: Autocomplete nid/vid extraction. i.e. CCK Nodereference
* #365241: Add select event to autocomplete feature
* #2537512: uid in the user autocomplete is confusing

Support requests

* Alter Node Reference Autocomplete Output - https://www.drupal.org/node/364768
* Can I remove [nid:n] in node reference fields? - https://www.drupal.org/node/487554
* Best way to get the uid from user in ajax autocomplete - https://www.drupal.org/node/2845850

Stack overflow
* https://stackoverflow.com/questions/1515722/removing-nidn-in-nodereferen...

Stack exchange
* https://drupal.stackexchange.com/questions/200498/hide-the-term-id-on-au...
* https://drupal.stackexchange.com/questions/146983/how-can-i-hide-the-ent...
* https://drupal.stackexchange.com/questions/227954/how-to-remove-taxonomy...

Contrib

Entity Reference (https://www.drupal.org/project/entityreference)

* #1802916: Add option to autocomplete widget to hide entity ID
* #1743342: Remove brackets (id) from display?
* #1411304: Autocomplete hide id options for use with unique labels

Linkit module (https://www.drupal.org/project/linkit) uses its own autocomplete field in the widget and offers the option to use tokens to add metadata.

Other contrib issues

* #2389317: UX: how to hide entity ID from autocomplete list
* #2400015: When editing an existing entity with entityreference autocomplete fields, load the views dropdowns in Select2 or remove the parenthesised numbers
* #640832: Remove [nid:n] in nodereference fields, so only title is shown
* #157545: Have [nid:n] hidden from user
* #2179861: How To Hide The Term ID After the Term
* #2291575: How the entity id is handled on submission?

(note: Should this be forms system or entity system? Going with forms for now. But entity seems equally likely)


Viewing all articles
Browse latest Browse all 291237

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>