Search code examples
drupaldrupal-7drupal-viewsdrupal-views-relationshipnodereference

How to stop multiple records returned on reverse node reference Drupal 7


I am using the 'references' module and the 'views' module (D7). I have two custom content types - 'Universities' and 'Courses'. The Universities content type has a custom field (field_courses) which references university courses' nodes and can have multiple nodes attached.

I have created Universities 'Harvard' and 'Yale' and created a course called 'Animation'

I have attached the Animation course to both Yale and Harvard.

I have created a view '/courses' and added the relationship: 'Content: Courses (field_courses) - reverse' and have also added '(field_courses) Content: Title (Uni)' in the fields section.

This creates my view.

The problem with the view is that it is returning two animation records (one for each uni) but I only want one record (with the uni's returned as an array within the single record.

For example the data I am getting back is:

course: Animation
Nid: 1239
description: Animation course
Uni: Harvard

course: Animation
Nid: 1239
description:Animation course
Uni: Yale

I would like it to be:

course: Animation
Nid: 1239
description: Animation course
Uni: Harvard, Yale

Is it possible to change this in this views module?


Solution

  • Views Aggregator Plus module will do what you require