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

delvalle’s picture

Nobody can help me? Pls, I'm really stuck with this!

delvalle’s picture

Due to lack of responses, I'm offering now a little bounty to someone who can help me. See conditions here.

delvalle’s picture

I'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).

delvalle’s picture

Finally found a solution in this great blog

delvalle’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.