Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I need a view that lists nodes of two content types (A and B). But I also want to limit B to certain taxonomy terms. So if I add a taxonomy term filter, it would filter out all nodes of content type A. Is there a way to only filter taxonomy types against content type B?
I can probably figure it out if I know where to start, but for now this is pretty unclear to me.
Thanks in advance,
Danny
Comment | File | Size | Author |
---|---|---|---|
#9 | views_query2.png | 63.93 KB | Danny_Joris |
#7 | views_settings_feed.png | 53.76 KB | Danny_Joris |
#4 | views_query.png | 42.96 KB | Danny_Joris |
Comments
Comment #1
Danny_Joris CreditAttribution: Danny_Joris commentedTo be clear: I want all these fields in the same view, as I need to randomize them all.
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedI don't think there is a way to do this with Views because of the way taxonomy terms work. You need an OR, which isn't really supported by Views 2 at all, and taxonomy terms don't play nicely with the Views OR module. It might be possible in Views 3 with the OR conditions.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedArgh you got me wanting to know the answer now after our IRC chat!
Found this:
http://sethsandler.com/software/drupal-6-creating-activity-stream-views-...
(discovered here http://drupal.org/node/726252#comment-2994594)
Comment #4
Danny_Joris CreditAttribution: Danny_Joris commentedI've been told that hook_views_query_alter might work so I added this in a custom module:
See attachment.
Would it be possible to add a second array to the "where" array? I also wouldn't know how to fill out the %s replacement patterns...
Comment #5
Danny_Joris CreditAttribution: Danny_Joris commentedWow, you guys are fast :) Tnx
Comment #6
dawehner@Danny
Does the link at #3 helps you to solve the issue, so this can be set to "fixed"?
Comment #7
Danny_Joris CreditAttribution: Danny_Joris commentedI'm trying to use #3 - for now without success.
I have this for my custom_views.module.
For now it only outputs the twitter feed nodes. I also need the news_item titles.
Views settings screenshot in attachment.
Comment #8
Danny_Joris CreditAttribution: Danny_Joris commentedI've been juggling around with the field settings and the Union Query order for quite a while now, and I must come to the conclusion that it probably is not going to solve my issue. The output is just too messed up.
Thanks for your feedback, everybody! I appreciate it.
Comment #9
Danny_Joris CreditAttribution: Danny_Joris commentedAh, and in #4 I accidentally added a wrong screenshot. This is the correct one.
So it's not possible to add a second array to "where" , right?