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 (fruits, vegetables...). If a user have selected that he likes "yellow" and "fruits", he should see in the view only the nodes that match both criteria: yellow fruits (i.e. 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 found two possible solutions (both should be easy to implement, but my knowledge in these fields is really limited):
SOLUTION 1) PHP code in a Contextual Filter, in order to filter the appropiate taxonomies. My use case is pretty similar to this, with 3 differences from the use case described in that issue:
- I'm using D7 (that issue is about D6 and uses content profile, that is not available as a separate module in D7)
- I want to show in the view "normal" nodes (the poster of that issue was trying to show profile nodes from other users).