使用ORed标准过滤Drupal视图 [英] filtering a Drupal View with ORed criteria

查看:63
本文介绍了使用ORed标准过滤Drupal视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试提供一个Drupal视图,该视图在两个CCK文本字段之一中显示在其中显示用户电子邮件地址的节点。不幸的是,使用普通版的Drupal的视图模块似乎无法实现这一点-似乎没有一种方法可以合并过滤条件(与操作除外),也似乎不是一种进行自定义的方法筛选器设置的逻辑...

I'm attempting to present a Drupal View that shows nodes in which the user's e-mail address shows up in one of two CCK text fields. Unfortunately, this doesn't seem to be possible using the stock version of Drupal's Views module - there doesn't appear to be a way to combine filtering criteria (except ANDing them), nor does their appear to be a way to do the custom logic for the filter's setting...

是否有一种简单的方法将其他信息直接注入到特定视图的 WHERE 条款?如果不是,是否可以通过其他方式完成?

Is there a simple way of directly injecting additional information into a specific View's WHERE clause? If not, can it be done in another way?

推荐答案

您可以使用 views_or 模块。

另一个选择是将 hook_views_query_alter 与$ query-> add_where()一起使用。您应该能够添加or子句。您还可以使用它添加您要求的附加 WHERE 子句。

The other option is using hook_views_query_alter with $query->add_where() you should be able to add an or clause. You can also use it to add your aditional WHERE clause that you asked for.

这篇关于使用ORed标准过滤Drupal视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆