I've got a specific content type. One field is a term reference field called "blog subject" in which a content author tags the node.

Ok. Moving on to the end user. I added the same term reference field to user account settings in which a user can select certain terms that they're interested in.

I would like to create a view in which the contextual filter is the user. By going to www.whatever.com/blogs/12, I can see content that matches the users selected interests.


1 Answer 1


Create a view showing users, and use a contextual filter on User:UID, and set 'Provide default value' the the 'Currently logged in user'.

You then should create two Relationships. The first on User:blog_subject will relate the user to the taxonomy terms. The second, using the first, will be on Taxonomy Term: Content using Blog Subject which will then relate the term to the content. Both relationships should be 'Required'.

Once the relationships are in place, delete the 'User Name' field that is a default for the type of view you created, and add the Content:Title field displayed as a link to content. Add filters like Content:Published to eliminate un-published content and a sort by, for example, Content:Post Date (desc). All of these fields will be using the relationships. Make sure you delete all the User:... filters and sorts.

With multiple terms possible, this may create duplicate rows. There are two approaches you can use. The simplest is to go to Advanced > Other and configure the Query Settings to 'Distinct'. This might work. The other is to list the term and Set the view to Group By the term. That way you will get a list of pages that conform to each subject. If a page appears multiple times, it will do so under separate subject lists.

This should show a list of content matching the interests of the current user.

  • Thanks...was missing one of the relationships. Perfect. Danke! May 31, 2013 at 20:07
  • I was getting duplicates as mentioned, 'Distinct' wasn't working for me and I didnt want to have my content grouped together in the view. I solved this with Aggregation. Enable aggregation in Advanced > use aggregation. Select aggregation settings on a unique field (in my case title) > aggregation type "group results together" > group column "value" > apply. Jul 26, 2021 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.