0

I've got a Field which is called "Primary Article" which is an Entity Reference Field. I've configured this field setting the "Reference Type" to be "article", so that only articles show up in the Form when editing this field. I would want to add two customizations to the current autocomplete field: enter image description here) 1) only return some articles based on some logic ( like I only want to return articles which are not selected as primary articles for another taxonomy )
2) change the text of the autocomplete field, so in this case, instead of "Primary Article" I would want to return "Primary article - XYZ" where XYZ is a custom field

marked as duplicate by 4k4 8 Sep 9 at 6:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

1.) You can create the limited list of Articles with Views, then use that Views in the Entity reference Field settings as the source.

2.) This should have probably gone into a separate question. Try researching into modules related to autocomplete, like: Search Autocomplete, Autocomplete Search Suggestions.

  • For point number 1), I would prefer a "code only" solution, I don't want to install new modules. – Nicola Peluchetti Sep 8 at 19:24
  • Views module is in D8 core ;) – prkos Sep 8 at 19:47

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