I have a Program content type which has a Paragraphs field which uses an Entity reference to a Course content type. Basically, when adding a program, I'm able to add a listing of what courses are available each semester. The semester is the paragraph field which includes a title (Ex. Semester 1) and then unlimited items to add the courses per semester. The courses are then shown on the program page by name and code and you're then able to click on the program name which takes you to the course page. This page has a description of the course and all the other info about it.

I have everything working how I need so far but what I'd like is to create a block view on each Course page that pretty much lists all the programs which this course is being taught in. I'm assuming I have to create some sort of Contextual Filter and perhaps a Relationships filter but everything I've tried has been a failure.

To sum this up: If a course is used by a program, display this program title on the course page in a block view.

Edit: Some images for reference

This is how the add courses paragraph looks on the Program content type Adding a Semester

This is how the course page looks at the moment. I'd like an aside to the right showing the programs this course is taught in. Course page

Edit 2: My relationships available

Here are the relationships that have the field courses: Relationships available

  • If seems like you need to add two relationships, first to the paragraph and second to the referenced entity. After that all fields from both the parent and the referenced entity should be available for filtering and displaying. – 4k4 Feb 23 '18 at 7:54
  • @4k4 I've edited the original post to show you the available relationships that have the courses field. I've tried every variation but can't seem to get it to work. Is there something I'm missing? – ACanadianCoder Feb 23 '18 at 15:29

I ended up figuring out what was needed for my issue. A Contextual Filter and a Relationship needed to be set.

For relationship, I needed to select Paragraph referenced from field_courses. Then the contextual filter needed to be Courses (field_courses) Paragraph (category) Appears in: semester_courses (Description).

Now when I go to each course, it displays what program that course is taught in.

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.