TransWikia.com

How to make relationships between users

Drupal Answers Asked on December 22, 2021

I have the quiz module installed on my website. I have setup two user roles on my site, Student and Parents.

I want to make a view that shows the results of a parents children.

Now I have made two fields in the registration using the profile module.

The number of student
The number of parent

These two fields are now available both for parents and their children. How can I fetch the results of a parents children using this relationship?

I’m thinking I should I say:Show the result of the users were the field “profile_no” is the same?

Is there a better way to make relation between two users?

Thanks everyone!

One Answer

Using the Entity reference module you can reference all entities (nodes, users, terms etc).

When you use the Entity Reference module you get a field where you can choose one ore many entities to reference. In this case it will be other users you choose (children).

This is the way it could look when you choose children in your user profile.

Entity reference module in action

I suggest you read up on the Module Monday blog post by Jeff Eaton about Entity Reference. to get up to speed on relationships.

Answered by Pontus Nilsson on December 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP