Trying to get Node id of REFERENCING node.

tpainton - July 9, 2009 - 19:01

I see everywhere ways to get the id and field data of REFERENCED nodes. Nowhere can I find information on getting the node id or any other data for that matter from the REFERENCING node.

The situation I have is I have a referenced node that has a flag. When the flag is set, I want the node the node's title to change (that's easy) then I want to redirect the user back to the REFERENCING node.

To make matters worse, I can't even find a way to place a backlink on the referenced node. Can't use backlinks module as I am in D6, nodereferrer module wont work because the referenced node is created using node-auto-create!

This seems like such a logical need and yet, I can't figure out a simple way to do it!

All help appreciated!

_

WorldFallz - July 9, 2009 - 19:19

I use nodereferrer for this all the time-- why doesn't it work?

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

using auto node create.

tpainton - July 9, 2009 - 22:33

I make the node reference using auto-node create. Does nodereferrer create the referenced node if it doesn't already exist? I got the impression it did not. If it does, GREAT, my problem is solved.

_

WorldFallz - July 10, 2009 - 00:59

Nodereferrer doesn't create anything-- it's simply a read only field that lists all the nodes that reference the node it appears on.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

So, back to step 1. Would be

tpainton - July 10, 2009 - 20:53

So, back to step 1. Would be great to be able to get node id if REFERENCING node. I don't really understand why the importance of REFERENCED node. The link already exists in the node body.

_

WorldFallz - July 10, 2009 - 21:28

I always get confused with references and referrers. I think we're just talking past each other, lol.

Ok, content type A has a nodereference field to content B. Content type A refers to content type B -- no problem, you can just print the value of the nodeference field on content type A to get the nid of content type B.

The problem is, on content type B you don't have any clue which content type A nodes reference it. By adding a nodereferrer field to content type B, you now get a read only list of all the content type A nodes that reference that content type B node (something you didn't have before, and which is quite a pain to obtain without a nodereferrer field). It's the other 1/2 of the relationship so to speak.

whew... does that clear it up or confuse it more?

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

AHHHHHHHH

tpainton - July 12, 2009 - 04:46

Okay. I get it. I THOUGHT that nodereferrer was an alternative node reference cck field for node A that automagically created a backlink on Node B. Therefore, since I use node-autocreate, I thought I was screwed.

Now I understand that nodereferrer is actually a read only field on Node B that references all the nodes that point to it! What a great module!

Perfect. Just what I need.

 
 

Drupal is a registered trademark of Dries Buytaert.