0
votes

Drupal 7 views show nodes filtered by user profile field

In Drupal 7, create taxonomy vocabulary "Interests". It has terms sports, arts, computer...

admin/structure/profiles create main profile. It has field with term reference to "Interests" taxonomy.

The node is related to "Interests" terms also.

Want to create a view to only display the nodes that users are interested. For example, if a user profile has only terms sport and computer, then only nodes related with "Interests" sport or computer show up.

1

1 Answers

0
votes
  • Create a new View showing Users, rather than Content.
  • Add a contextual filter for User: Uid with the default value User ID from logged in user.
  • Add Fields: Interests as a relationship.
  • Add Taxonomy term: Content using Interests as a relationship.
  • Replace the User fields displayed with Content fields.