I have a content type 'Player' which has an entity reference field to the content type 'Tournament'. The entity reference field allow multiple values (a player can join several tournament).

I'd like create a view of all Player nodes filtering on the 'Tournament' field. When i try to add the entity reference field as filter nothing happens (I have installed the 'Views Reference Filter'). I need also to expose the filter to the users using a droplist.

Can someone help me? Thanks

  • Hi @Andrea Moraglia I tested it on my local machine and it works fine for me, but one thing did you chick ( Render Views filters as select list) this checkbox when you create an entity reference field? – Said Yousafzai Jan 4 '16 at 15:36
  • @Said Yousafzai yes I did. Unfortunately doesn't work for me. I tried to delete and recreate the field but still doesn't work. I don't know if it is a problem about relationship – Andrea Moraglia Jan 4 '16 at 18:20
  • can you give me the site access to take a look, my skype id said.ulhaq – Said Yousafzai Jan 4 '16 at 18:33
  • I tried it on another drupal installation and it works fine. So I created another field with same settings but different machine name and it works fine. Thank you for the answers! – Andrea Moraglia Jan 5 '16 at 13:29

Follow the following steps.

1) First create an entity reference field in your content type (player) and in the Entity Selection Mode select (Simple(with optional filter by bundle) and then check Tournement checkbox, And in Additional Behaviors check (Render Views filters as select list) and save your content type.

2) Create view of type Players

3) Add new filter and choose your reference field and apply

4) Check (Expose this filter to visitors , to allow them to change it) checkbox.

6) Select Operator (Is one of) and in options check (Select all) checkbox

7) Click on Apply button and save your view.

That's all, now you are ready to filter the view using your reference field.

| improve this answer | |

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