문제

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?

도움이 되었습니까?

해결책

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top