如何使用 OR 表达式更新 Drupal Views 2 查询?
我想通过以下方式向 Drupal 6.x Views 2 查询添加 OR 表达式:
现有查询:
SELECT node.nid AS nid FROM node node WHERE (expr1) AND (expr2)
新查询 - 这就是我想要实现的目标:
SELECT node.nid AS nid FROM node node WHERE (expr1) AND (expr2 OR new_expr)
问题是如何更新我现有的查询(使用 Views 2 构建) UI)与views_query_alter或其他一些钩子以获得expr2
与new_expr
OR'ed?
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
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Views Or - 开发版本,但它可以工作。
Views Or - dev version, but it's work.
您还可以使用 Views 版本 3.0(目前处于 alpha3 版本,非常稳定)http://ftp.drupal.org/files/projects/views-6.x-3.0-alpha3.tar.gz
它支持视图过滤器的
OR
ing盒子的。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
OR
ing of views filters out of the box.