1

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.

Thoughts?

3

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.

| improve this answer | |
  • Thanks...was missing one of the relationships. Perfect. Danke! – Matthew Gann May 31 '13 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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