开发者

Filtering with multiple flags in a view

开发者 https://www.devze.com 2023-04-03 09:06 出处:网络
I\'m building a Drupal site that has a database of local services. I\'m using 2 vocabularies to categorise the services by:

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:

  1. Flag the local wards/neighbourhoods they want to find services in.
  2. Flag the types of service they are interested in
  3. 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 hel开发者_Go百科p would be much appreciated.


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/

0

精彩评论

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