0

I currently have a view block called Offerings that shows up on all my Course content-type pages that display all the offerings for the said course. These offerings are their own content type called Course Offerings. The Course Offerings content type has a field_course_reference field so to know which Course the offering is for. In order for it to show the proper courses on my view, I have a Contextual Filter set up that references the field_course_reference and have it set to "Provide default value" of type "Content ID from URL". My Course content-type also has an Entity Reference taxonomy field called field_course_category.

What I'm trying to do from the Offerings view is grab the field_course_category that lives in the Course content-type in which the view is being displayed on. I've tried adding every type of relationship and played around with a bunch of settings but no matter what I choose, the field I create remains empty and doesn't seem to grab the taxonomy term that I'm looking for.

Does anyone have any idea on how to go about doing that?


I'll try to draw the structure out a bit below as well to hopefully clear up any misunderstandings.

Content Types:

  • Course
    • field_course_category
  • Course Offerings
    • field_course_reference

View Block:

  • Offerings
    • This view lists all the "Course Offerings" content types on the "Course" pages using the field_course_reference contextual filter using "Content ID from URL".
    • Trying to also get the value of field_course_category on this view so that I can use some conditional logic.

Let me know if anything else is needed to clarify. Again, any help would be much appreciated.

1 Answer 1

1

Well, I ended up figuring this out myself after digging deeper into relationships so I'm just going to post what I did in case anyone else ever comes into a similar situation.

I had to create 3 new relationships in this order:

  1. field_course_reference:content - This appeared in my "Course Offerings" content type
  2. Taxonomy term referenced from field_course_category - This appeared in my "Course" content type. I had to use #1 above as a relationship.
  3. Content using field_course_category - Relate each content with a field_course_category set to the taxonomy term. This had to use #2 above as a relationship.

Then, I went over to my fields and selected the Category of "Taxonomy term" and chose Name. I selected the relationship of field_course_category: Taxonomy term and the data that I needed was now displayed properly.

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.