views:

27

answers:

2

I'd like to add an OR expression to Drupal 6.x Views 2 query in the following way:

Existing query:

SELECT node.nid AS nid FROM node node WHERE (expr1) AND (expr2)

New query - this is what I want to achieve:

SELECT node.nid AS nid FROM node node WHERE (expr1) AND (expr2 OR new_expr)

The question is how to update my existing query (build with Views 2 UI) with views_query_alter or some other hook in order to get expr2 OR'ed with new_expr?

+1  A: 

Views Or - dev version, but it's work.

Nikit
thanks, this is my solution for the moment
tomex
+1  A: 

You can also use Views Version 3.0 (currently in alpha3 so quite stable) http://ftp.drupal.org/files/projects/views-6.x-3.0-alpha3.tar.gz

It supports ORing of views filters out of the box.

Sid NoParrots
Thank you for the hint. However, I don't want to migrate to Views 3 yet.
tomex
Try it. Views 3 is quite stable and has tons of new features!
Sid NoParrots