1
votes

How would I go about implementing the following content types + fields

School

  1. Title (name of school)
  2. location (geolocation - geofield)

User Properties (students)

  1. school (entity reference)
  2. class
  3. location (geolocation - geofield)

every student has one school. Now I want to create a View with a list of all schools and display the number of students. For example: school one has 25 students.

I found an example: https://drupal.stackexchange.com/questions/42352/display-number-of-times-content-is-referenced-in-content but by trying this I get an error: *SQLSTATE[42702]: Ambiguous column: 7 ERROR: column reference "nid" is ambiguous LINE 9: GROUP BY node_title, nid, node_created) subquery ^

Thanks!

1

1 Answers

0
votes

You can do it using Nodereference count module: https://www.drupal.org/project/nodereference_count

Another valid module is Entity Reference module, but it has only a dev version: https://www.drupal.org/project/entityreference_count