Dear all,
if you are looking for an option to filter for "all of" through entity reference - you can do this as per this change in entityreference_filter/views/entityreference_filter_view_result.inc
-class entityreference_filter_view_result extends views_handler_filter_in_operator {
+class entityreference_filter_view_result extends views_handler_filter_many_to_one {
This might not be persistent, but experimental as discussed here:
- #1494884: Why is there no "is all of" operator for select list filters?
- #1766338: Incorrect filter group OR behavior, LEFT JOIN changed to INNER JOIN
The reason I am using this for my productive sites is simple: I have a list of items that I would like to filter by multiple referenced entities. What I needed was the result to shown only nodes that include all references. As of now it was only possible to filter by single references.
| Comment | File | Size | Author |
|---|---|---|---|
| entityreference_filter.component.patch | 513 bytes | nhck |
Comments
Comment #1
maximpodorov commentedI think "is all of" operator is inappropriate for this module goals. Please reopen the issue if you can provide more details of your idea.
Comment #2
nhck commentedI have added a sample use case accordingly. Hope it helps. Imho a lot of usage explanation is already included in #1494884: Why is there no "is all of" operator for select list filters?
Comment #3
maximpodorov commentedIs your patch appropriate for any situations this module was created for?
Comment #4
nhck commentedThis module allows to pull in a view to provide filter options. In practice these filter options are exposed as checkboxes. As of the current configuration, If you check multiple of those checkboxes, you can only be shown results which are related to one of or to none of the chosen boxes. It is not possible to have the shown results satisfy all of the checked boxes.
The answer to your question hence is No: it is an upstream feature extension of the original set thus this feature request. Downstream modules like this can easily implement it. When you build this module - it was built on top an existing class structure. This class structure offers more features now and this one is specifically useful. It would be a waste if downstream modules like this wouldn't implement it.
But of course, I'd understand if you like to postpone this, even for the dev version, until the referenced issues are resolved.
Comment #5
nhck commentedComment #6
nithinkolekar commentedafter four years this issue last updated nor views or any other other module implemented this feature which is very useful to get entities having same nids among them.
ex:
list of products purchased same as user X (current user for ex)
list of movies with common 3 actors
list of user studied in same city and school (both entity ref fields)
From the beginning views has built in(hardcoded) contextual filter like "Content: Has taxonomy term ID" with configuration
"Taxonomy term id from url" >> "Load default filter from node page, that's" >> "Filter to items that share all terms"
but not extended to support EntityReference fields.