1

I need to setup a view for a parent which shows the result of his child. The result is a content type which has a user reference field to each student who owns the result.

Each students' profile has a user reference field to his /her parent username. I.m using profile 2 to setup parent and children account differently.

By using contextual filter and relationships, I can easily show the fields of the result to each student who owns the result but since parents' account are different, I really don't know how to show contents linked to individual student to show in their parent account.

0
  • Download and install the Entity Reference module

  • In parent user fields, add a field with Entity Reference and a widget of Auto complete (tag style)

For example: I named mine lalala (click picture below to enlarge)

enter image description here

  • For Target Type, select User
  • Number of Values: Unlimited (as parent could have more than 1 child)

enter image description here

  • Then go to the parents account and start typing child's account user name, you will see the name in the drop down, select it and save.

Use a comma , to add other child account. (parent has more than 1 child)

enter image description here

In your view

  • contextual filter of User id (uid) (which uses the parent's id)
  • add a relationship of lalala Referenced Entity

    • If not, try Referencing entity, but if my memory is correct it's Referenced
  • Wao! Letme quickly try that. Will get back to you now. Thanks – primerater01 Dec 26 '15 at 13:52
  • @primerater01 how did it go? – No Sssweat Jan 31 '16 at 11:00
  • I actualy employed another method which worked perfectly the way i want it. Bt i tried ur approach and it did work too. Thank you. – primerater01 Jan 31 '16 at 18:14
  • Could u share me ur email or facebook name if u dnt mind please? – primerater01 Jan 31 '16 at 18:19
  • I rather that you msg me here and then we can use the chat if we need to :-) chat.stackexchange.com – No Sssweat Feb 1 '16 at 3:19

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.