This module is great, just what I need.
When adding an existing entity, 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.
This same issue has been raised several times in relation to the autocomplete widget in the Entity Reference module. (See for example https://www.drupal.org/node/1802916 and https://www.drupal.org/node/1411304) There are various solutions proposed in those issue threads, including using the Chosen Ajax module whose developers have made some efforts to hide this entity ID. But none of these solutions seem viable for use with IEF.
I understand that the IEF module uses its own autocomplete code, which I have looked at. The selection of an existing entity is dependent on this entity ID which shows in the autocomplete list, and I see that if I remove this ID from the autocomplete results, the whole thing breaks.
I wonder if anyone has an idea for how to hide this entity ID so that it does not display in IEF's autocomplete list? Thanks so much for any thoughts on this.
Comments
Comment #1
bojanz commentedAs you've seen, Drupal's autocomplete requires the ids to be present, there is no way around that.
You would need to remove IEF's autocomplete form completely, and implement a different UX that doesn't rely on Drupal's autocomplete.
Comment #3
designarti commentedDrupal may require it, but it shouldnt be visible to the user. It should only be sent as request.
Because of this issue not being fixed, the only way we can use autocomplete is with views. Not so bad, but most of us would've chosen not to use views.
Comment #4
paramnida commentedWould it be possible to hide it with a JavaScript?
Comment #5
afeijoYes, you can hide it with JS. I found this code
http://blog.2pha.com/removing-entity-id-drupal-entity-reference-fields
Comment #6
2phaThe above link is now:
https://2pha.com/blog/removing-entity-id-drupal-entity-reference-fields/
:)