5

I have an autocomplete widget for a taxonomy entity reference.

Every term shows its entity ID between parentheses; plus, if the term name contains spaces, it appears between quotes, e.g. "Lorem ipsum (125)".

How do I remove the entity ID and the quotes?

3

You should have a look on Chosen module.

Chosen uses the Chosen jQuery plugin to make your elements more user-friendly.

Follow this steps:

  1. Install, enable and configure the Chosen module.
  2. Change the widget type of your field to "Select list" at Manage Form Display of your content type
  3. Check "apply chosen on this field" at Manage Fields > Edit of your field
0

In addition to the comment of f0ns, you can also use a Entity Reference view display to define the fields you want to search on and how they're displayed. You can use this view as an input for your autocomplete widget.

  • Thanks. It is a nice feature but it does not solve my problem. I can manually select the fields but the entity ID is still there. – Dorin Niscu Feb 11 '15 at 9:15
  • You're welcome. And indeed! It's apparently so 'common' in my head, that I didn't even notice it. Sorry about that. – Sidney Gijzen Feb 12 '15 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.