Here is what I did to add a multiple select exposed filter of nid
to a view, just make a example for you here.
- I would like to create a views listing movies('movie' content type).
- Movie has a cast field which lists actors('actor' content type).
- I want to have search movies by actors, which need to support multiple select.
In above example, actors are nodes. So I need a views exposed filter to pass multiple nids to views.
What I used to achieve that, is 'entity reference' module.
I created a entity reference field in movie content type called 'cast'. Which is referencing to 'actor' content type.
Then in 'cast' field setting, remember to tick 'Render Views filters as select list' as below:
Then you will able to add a nids exposed filter in views!!
In my movies views, add a new filter with Content: Cast (field_cast)
. Then you will see the select list and multiple options as below:
After adding that filter, you will have a multiple select filter and it should look like this:
NOTE: You may get duplicated result in some case, just enable the views advance 'Use aggregation' setting.
That's it! :)
The last thing I would like to do is make the multi select looks better. What I like to use is a jQuery plugin Sumoselect which you can add if you like.