开发者

filtering a Drupal View with ORed criteria

开发者 https://www.devze.com 2022-12-20 13:55 出处:网络
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 v

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...

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


You can use the views_or module. It's still in dev but looks promising.

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.

0

精彩评论

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

关注公众号