Can I add a node reference from "wrong side"?

I posted this earlier in the d.o forum, but I'm realizing this is probably a better place for my question.

I've been reading and reading about node referrer, node relativity, node reference, etc. and I'm stuck.

What I want to be able to do is allow users to add a node reference from either side of the relationship. Unless somebody can convince me it is a good idea, I would rather not have the reference recorded in two places (ie both nodes referencing each other).

Here is an example.

  1. I create a 'person' content type and an 'event' content type
  2. I add a node reference field to 'event' that is called 'volunteer'

I want my users to be able to create the connection regardless of whether they are editing the event or the person. Of course, by default they will be able to add a volunteer to an event while they are editing that event. (And with the "popups: add and reference" module they will even be able to create a new person on the fly, if the person doesn't exist yet.) But I also want them to be able to be editing the person and decide to add them as a volunteer to an event.

Seems relatively straightforward to me, but I'm completely confused about how to start. Some modules that seem to solve this problem are only for D5, which doesn't help my sanity.

Any suggestions?

Thanks,
-Joseph

Login to post comments

Node Referrer

Boris Mann's picture
Boris Mann - Thu, 2009-02-19 21:30

Node referrer is the only one that does bi-directional connections, IIRC.


Views Trick

Grayside - Tue, 2009-03-24 05:27

If all you want is a "nodereference backlinks" sort of thing, you can build that using Views. Not wanting to deal with Node Referrer, I needed to create just such a view for a task dependency mechanism. It took a lot of brain twisting to wrap my head around the necessary Views tricks.

  1. Create a Relationship on the Nodereference field.
  2. Create an argument in that relationship, default it to the currently viewed node's NID.
  3. Fields not in that relationship will now be drawn from nodes with a nodereference to the current node.
  4. Create as a block and drop somewhere.

thanks!

majnoona - Sun, 2009-05-31 13:29

Wow, thanks -- I've literally been laying awake at night trying to figure this out-- thanks!