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 "yellow" and "fruit", 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 also tried creating relations between relationships (like "chain relationships"), as proposed here, but I was unable to make it work.
Any ideas?
Comments
Comment #1
delvalle CreditAttribution: delvalle commentedNobody can help me? Pls, I'm really stuck with this!
Comment #2
delvalle CreditAttribution: delvalle commentedDue to lack of responses, I'm offering now a little bounty to someone who can help me. See conditions here.
Comment #3
delvalle CreditAttribution: delvalle commentedI've found PHP code that could do the trick in two different issues (http://drupal.org/node/557022 and http://drupal.org/node/562270, both answered by Dawehner).
Unfortunately, the solutions provided in those issues are for D6 and for slightly different uses cases. I don't know PHP, so I would really appreciate some help in order to adapt those snippets to D7, with my particular use case (explained in the first message).
Comment #4
delvalle CreditAttribution: delvalle commentedFinally found a solution in this great blog
Comment #5
delvalle CreditAttribution: delvalle commented