Drupal 7 视图 - 如何将上下文过滤器与常规过滤器(使用 OR)结合起来?

Drupal 7 views - how to combine a contextual filter with a regular filter (with OR)?

好的,所以我有一个 "playlist" 内容类型,带有一个节点引用字段和一个名为 "always display this playlist" 的布尔字段。

我有一个 "playlists" 视图,其中包含基于节点引用的上下文过滤器。所以,当我转到“/playlists/35”时,它会显示所有引用节点 35 的播放列表。

目前一切顺利。

一个额外的要求是视图还需要显示所有 "always_display_playlist" 字段设置为 1(即布尔字段)的播放列表。

所以基本上视图需要显示与上下文过滤器匹配或布尔字段设置为 1 的播放列表。

到目前为止,我在完成这项工作时失败得很惨。上下文过滤器效果很好,但当然它只会显示节点引用与参数匹配的播放列表。如何将上下文过滤器与另一个常规过滤器结合使用 "or"?

非常感谢任何线索或想法!

如果您单击过滤器旁边的下拉列表,您可能会使用两个不同的过滤器组,一个对应于上下文过滤器并使用 views filter harmonizer 管理它,另一个组使用布尔过滤器并具有 OR他们之间。

选项 1

考虑 Views Contextual Filters OR 模块,它目前只有一个开发版本。摘自其项目页面:

... provides a views plugin which modify query to support OR conditions for contextual filters.

选项 2

否则 Views EVI (Exposed Value Injector) 模块,目前只有测试版。摘自其项目页面:

This module solves the fundamental and longstanding problem (#357082: Pull filter value from an argument? & Itangalos Sandbox) of views argument filters (=contextual filters): they are far less potent than regular filters.

It does this by allowing to wire argument tokens to exposed filters and optionally hide them. It also allows new use cases, think: use one exposed widget for two filters.

学分(选项 2):Hubert