在视图中使用多个标志进行过滤
我正在构建一个包含本地服务数据库的 Drupal 站点。我使用 2 个词汇对服务进行分类
:区/邻里
b.服务类型
使用视图、标记和标记术语模块,我尝试建立一个界面,允许用户分 3 个阶段过滤记录:
- 标记他们想要在其中查找服务的本地病房/社区。
- 标记服务的类型他们感兴趣的服务
- 查看根据步骤 1 和 2 中设置的标记术语过滤的服务列表。该列表应仅显示步骤 2 中选择的类型的服务,并且仅显示在步骤 1 中选择的病房内。
每个阶段都是设置作为一个视图。前 2 个视图工作正常;用户可以标记病房和服务类型的条款。
问题是第三个视图,它根据标志过滤节点。在视图中,我为每个词汇表添加了标记关系。但是当我尝试过滤标志 1 和标志 2 上的节点时,没有返回任何记录。
看起来标志 1 需要作为第二个过滤器的参数,但我不确定如何将标志 ID 传递到 URL。
我正在努力解决这个逻辑,任何帮助将不胜感激。
I'm building a Drupal site that has a database of local services. I'm using 2 vocabularies to categorise the services by:
a. Ward/Neighbourhood
b. Type of Service
Using the Views, Flag and Flag Terms modules, I'm trying to set up an interface that allows users to filter the records in 3 stages:
- Flag the local wards/neighbourhoods they want to find services in.
- Flag the types of service they are interested in
- View a list of services filtered on the flagged terms set in steps 1 and 2. The list should only show services of the type selected in step 2 and only within the wards selected in Step 1.
Each of these stages is set up as a view. The first 2 views are working fine; users are able to Flag the terms for ward and service type.
The problem is the 3rd view which filters nodes based on the Flags. In the View, I've added Flag relationships for each vocabulary. But when I try to filter the nodes on Flag 1 AND Flag 2, no records are returned.
It seems like Flag 1 needs to be an argument for the second filter, but I'm not sure how to pass the flag IDs in to the URL.
I'm struggling with the logic of this, any help would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过创建自定义模块解决了这个问题,如下所述:
http://sethsandler.com/code/drupal-6-creating-activity-stream-views-custom-sql-query-merging-multiple-views-part-1/
I've solved it by creating a custom module, as explained here:
http://sethsandler.com/code/drupal-6-creating-activity-stream-views-custom-sql-query-merging-multiple-views-part-1/