0

I have created the following List field type of checkboxes to allow users to select their own content's privacy settings when creating a node called RideShares:

1|me only
2|any registered site member
3|users on the same flights as me
4|users arriving at the same airport during the same week as me.
5|public

I can use the exposed filter to manually select any matching nodes, but do not know how to automatically filter the queried RideShares to the current user's data in other bundle/content types. For example, whether the current user has entered a Flight into where the destination airpor catches one of the existing RideShares.

It seems this cannot be done with context filters in Views.

  • I am having trouble deciphering your penultimate sentence: "For example, whether the current user has entered a Flight into where the destination airpor catches one of the existing RideShares." Can you provide more detail? – Darvanen Sep 18 '14 at 4:10
0

I can use the exposed filter to manually select any matching nodes, but do not know how to automatically filter the queried RideShares to the current user's data in other bundle/content types. For example, whether the current user has entered a Flight into where the destination airpor catches one of the existing RideShares.

Views is a simple query builder. Typically this would be SQL like Select * From RideShares Where city = 'denver'. Your question cannot be expressed in single SQL expression you would need JOINs in SQL of PHP and multiple queries to arrive at an answer.

Your talking about relating a set of results with additional logic or data-sources.

This can be done in Drupal using a combination of Views Relationships perhaps Attachment Views to build results you want.

For example I might create a Nodequeue of uids that are users on the same flights as me and examine a View result that uses the Nodequeue as a Filter against the current user to see if that logic produces any results.

You could then place many view blocks on a single page that acts as a search results page. Each block can be a View with many view-attachments, etc.

  • thanks @tenken! i'll try this tonight, but it would seem faster to select the initally filtered list, the loop over and unset nodes that doen't match the current user's data. is there a hook after the view has run it's queries in order to edit the data? – E.A.T Sep 18 '14 at 5:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.