I have two types of users in drupal-7: children users and parents users. How can I design a relationship between these types of users?

Also How can I maintain this relationship in the code? i.e. getting the parent of the child or vice versa.

3 Answers 3


You can use the User Relationships module for that.

Administrators are able create relationship types (friend, coworker, etc). Relationship types can be setup to be one-way or mutual. If a relationship type is one-way (subscriber) only the requester is shown as relating to the requestee. Relationship types can also be set as needing or not needing approval.

I've used this module for one of my project. It works great!


Consider using the relation module. You can:

  • Create binary and n-ary relations among various entities.

  • Store meta information about the relationship in fields, as relations are fieldable entities.

  • Export/Import the relationship via features.

  • Specify the directional nature of the relationship.

Relations also ships with views integration, so you get that for free without any coding, plus, its got a neat API.


From official Dynamic Entity Reference module page on Drupal.org:

Dynamic Entity Reference provides a field type/widget/formatter combination for Drupal 8 that allows an entity-reference field to reference more than one entity type

DER has active development for Druapl 8 also

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.