开发者

How to update Drupal Views 2 query with OR expression?

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.开发者_StackOverflownid 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜