1

I'm trying to create a relationship from thin air, at least that's how it feels.

I have two account roles. Producers and Instructors. I want to be able to reference nodes (events) created by Producers on the related instructors profile page and vice versa. The caveat is that the 'referenced' accounts may not yet exist.

For example:

  • Producer A creates an event and lists Instructor B (who has an acct and profile) and C (who does not have an account) as the instructors via a multivalue text field (reference field is not possible here).
  • Once the node is saved, the system checks for a relationship between the text field data and user profiles. A relationship exists for Instructor B, so the nodes are displayed on her profile. No relationship exists for instructor C yet, so nothing happens.
  • instructor C comes a long and makes an account, when the account is saved the system checks for relationship again and finds a relatioship between previous nodes and this new account, the nodes are displayed on the profile.

I am thinking this field could be an email address or something. Is this possible and does anyone have advice on where to get started?

1

I can see how you'd want the Producer to be able to create an event and assign instructors to it before the instructor has an account. So in that case, have a node type which represents the instructor. This would be like a bio page or CV or some-such.

Then use nodereference and/or entityreference fields, Views, and viewreferences to connect the dots. The Event type would have Instructor fields which would refer to the bio pages for the instructors. As the instructors created accounts, a viewfield on the user profiles would show the bio page, keyed by an email acct field which you'd be sure and add.

Complex but not hard. :-)

  • Thanks! That sounds like the solution I'm looking for, I'll have to try it out tonight. One question though, any idea how I would hide the previous bio page after an account has been created? – filmoreha Mar 1 '12 at 7:56
  • An administrator could do it, but one of the things I point out here is that the bio could become a field on the user profile, with a viewfield. This would let admins change the bio without having the user do it, without having to change the acct profile. If that isn't clear I can re-write my answer. – paul-m Mar 1 '12 at 20:15
  • Thanks Paul! Your tip pointed me in the right direction! What I ended up doing (entityreference/relation modules were too complicated for this) was using taxonomy to tag by instructor name (spelling doesn't matter). I added an email field to the terms to use as view arguments. When the email matches an instructor account email, then a list of nodes tagged with the instructors name will be displayed on the user profile page via viewfield. – filmoreha Mar 3 '12 at 17:26

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.