4

The Setup:

A Taxonomy Vocabulary called "School" - During registration, users can choose multiple "Schools" from the taxonomy list to associate themselves with.

A content type called "Lesson" - Each lesson can choose a school from the taxonomy list to associate itself with.

The Challenge:

I would like to construct a view where the logged in user sees a list of lessons from schools they have associated themselves with.

I'm struggling to understand the relationships and (presumably) the contextual filters that I'll need to have in place to make this happen. Help!

1 Answer 1

9

You have the right idea!

You'll start with a View of "Lesson" content.

You'll then add a Relationship from the "Lesson" to the "School" taxonomy term, using the taxonomy term reference field configured on the "Lesson" content type.

Next, you'll add another Relationship from the "School" taxonomy term to the User entity type, using the taxonomy term reference field on the User entity. This is a reverse relationship; in the Views interface, it will be labeled something like "Taxonomy term: User using [name of reference field]". (My suspicion is that this is the part you're missing.)

Finally, you'll add a Contextual Filter "User: Uid", configured to provide a default value of type "User ID from logged in user". There will be a configuration option here to select the Relationship to use for this contextual filter, but at this point it should already be selecting the only User Relationship that is currently configured.

1
  • 2
    You are a GOD amongst mere mortals. My sincerest thanks to you! And yes, it was the missing reverse relationship that was throwing me off.
    – Sam
    Sep 3, 2015 at 21:56

Your Answer

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

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