Active
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Aug 2011 at 08:41 UTC
Updated:
31 Oct 2019 at 20:22 UTC
Jump to comment: Most recent
Comments
Comment #1
carn1x commentedComment #2
carn1x commentedJust realised I can accomplish this with the following:
Still, it would be nice to know if my original filter set is possible, or on the radar for Views since it feels like thats the "right" way to do it :)
Just as a side of ass kissing; the more I use Views 3 the more I love it, fantastic work from those responsible!
Comment #3
dawehnerYou can only have one additional level but you can transfer any logic very easy.
Let's assume you have (A OR (B AND (C OR D)). Replace OR with a + and AND with a "x" and expand it like in math.
The result is what you want to set up.
Comment #5
RollWhisTler commentedvery nice... but what if some values are exposed? you cannot duplicate them, right? they would show duplicate entries in the exposed form...
Comment #6
RollWhisTler commentedsorry, i forgot to change d'status...
Comment #7
m42 commented+1 for RollWhisTler, I'm actually facing the same problem.
Comment #8
hoporr commentedI think the solution with the math-analogy is valid from a logical standpoint, but not always practical if there are a ton of AND cases
(X1 AND X2 AND X3.... Xn) AND ( (Y1 OR Y2) AND (Y3 or Y4)) .
You'd end up having to repeat all 'n' cases of the Xs. That's maybe OK if you deal with a very small 'n,' but not so much if you have many.
Plus, as other comments showed, there are problems when some of the Xs are exposed.
Nesting would really be helpful.
I seem to remember that the old Views-Or (D6) module had nesting, did it not?
Comment #9
gagarine commentedComment #10
gagarine commentedActually this is a feature request.
Comment #11
knsheely commented+1 This feature would be very helpful. The math analogy is not practical at all in my case.
Comment #12
Offlein commentedIt would be super useful to have this. For instance, I have a "keyword search" (through exposed filter) view that contains 2 different content types -- one of which has a workflow attached to it and must be in the "Approved" state. The other has no "Approved" state and will always fail if that constraint is applied. I can set them in two separate groups, but cannot set the exposed filter on both.
Comment #13
cferthorney+1 . I'm trying a similar thing to Offlein but querying search_api indexes, which don't seem to call hook_views_query_alter in the same way as I would expect (I've not looked too heavily into this yet though so what I am after may be possible with a different hook) The feature would be nice whether I'm able to achieve what I need with a different hook or not.
*edit grammer and spelling tidy up*
Comment #14
gamesfrager commentedI'm also in the exact same situation.
- two content types products and articles
- one content type has a field of main product the other content type doesn't have such field
- one exposed search field
- need to display results from both content types but if it's a product content type, then check if main product field is set to "yes"
Have been trying for the past few days to find a way to do this.
Comment #15
merlinofchaos commentedSorry, I won't let this go to major.
We made a conscious decision to limit the complexity available here. When you're to the point where you need to nest filter groups, it's time to just write a custom filter handler that can do the job.
Comment #16
gamesfrager commentedFair enough, but for me and many others who don't know how to write custom code, what are the options?
I will happily use 10 other modules to allow me achieve this result. If you know of a way, please do share.
Thanks.
Comment #17
kpaxman commentedI have to say I wish for this functionality as well. If I have a number of fields that are in every group with the exact same settings, it's difficult to read and maintain. There also doesn't seem to be a way to work this with an exposed field.
Is there simple, easy-to-read documentation for creating custom filter handlers, written for beginners who have never written code for views?
Comment #18
andersiversen commentedOne thing that would make things easier is if it could be possible to copy filters, especially in the organize window where you can add filtergroups and drag and drop the filters around. Say if you dragged a filter to another filtergroup, it could ask if you wanted to copy it, or maybe if you pressed shift or ctrl while dragging, it would be "copy and move" instead of move.
Comment #19
hazah commentedI think what would solve this problem is an ability to create a filter using rules. It works great as a validator plugin for contextual filters. Just a thought.
Comment #20
mvlabat commentedIt will be a very useful feature. Looking forward for any progress in implementing this.
Comment #21
enboig commentedAny way to unlock #15? My query isn't complicated, and I could use populate filter to avoid duplicated exposed filters, but my exposed filters rely on datepicker and other javascript helpers, and "filters populate" only allow text.
Could it be overriden with query_alter with a custom module?
Thanks.
Comment #22
handkerchiefKeep this going:
https://www.drupal.org/node/2921987
Comment #23
solideogloria commentedThere is no way to "use math" to factor an expression if the values are Exposed Filters. Duplicating these filter items will duplicate them on the interface for the user.