0

In Views filter I have added user reference field and its showing me as select drop-down. I have exposed that field in the filter.

Those user reference fields are related to a content type, but I want those as auto-complete fields instead of drop-down, just as taxonomy fields can be drop-down or auto-complete fields.

The issue with select list is that there are thousands of users in that list and it is taking time to load all values and render the page.

How can I achieve this?

0

1 Answer 1

2

To get User Reference Field as autocomplete exposed filter,

  • Let me consider you have created a user reference field in your content type as Users-ref

Now in your View :

  • Add a relationship for your entity reference field for Eg: Entity Reference: Users-ref and make it required.

  • Now add a filter criteria User:Name with the relationship Entity Reference: Users-ref

  • you should find (User entity referenced from field_users_ref) User: Name (exposed) in your filter criteria now.

  • And this should be an autocomplete widget!!

There is also a module named Views Autocomplete Filters along with this wonderful tutorial!!

4
  • views autocomplete filters only works with text field not user reference fields or any entity reference fields
    – pown
    Commented Dec 5, 2014 at 10:34
  • In the tutorial I mentioned, You could find a way to make it use for entity reference fields. and for user reference I followed the above-mentioned steps without using the module. Commented Dec 5, 2014 at 10:38
  • @PravinAjaaz: Views Autocomplete Filters seems to be working for textfields alone. I have user reference fields in that content type, which i am exposing in the view. That one I want to make it as auto-complete instead of drop-down.
    – Ram
    Commented Dec 5, 2014 at 12:30
  • I just followed these steps I listed without installing the module. Did you tried those steps? Commented Dec 5, 2014 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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