Filter view based on several user profile fields (D7) I’m trying to apply automatically several filters to a view based on the corresponding profile fields selected by the current user.
For example, the users can select a favourite color (yellow, blue...) and a favourite food (fruit, meat...). If a user have selected that he likes &quot;yellow&quot; and &quot;fruit&quot;, he should see in the view only the nodes that match both criteria (yellow fruits): bananas, lemons...
This is pretty easy to do when there's only 1 field to match (following the process indicated here), but this same process doesn't seem to work for matching several fields (the content field of the view only allows 1 relationship).
I've tried creating relations between relationships (like &quot;chain relationships&quot;) and doesn't seem to work, but maybe I'm doing something wrong (I don't have a really deep understanding of how relationships work).
Any ideas?
Maybe using the Relation or Entity Reference modules? Or some PHP code?
You should try chain relationship, this discussed here, similar problem to yours.
Here the answer on similar question on drupal.stackexchange.