How to pass float field value from node(content type A) to another node(content type B)?
which content type B referenced to content type A by using reference from url widget.
thanks
-
When do you want to pass the values?– Patrick KennyMar 31, 2012 at 6:49
-
when creating a new node (content type B).– AbdulrahmanMar 31, 2012 at 6:57
1 Answer
First of all: This introduces redundant data into your DB. Generally this isn't a good idea.
If you must for some reason:
You can implement hook_node_presave for content type B. You get the fully populated $node. This gives you the possibility to load the referenced node type A and grab the value you want to set in B.
Maybe you want to consider to implement the same for content type A. This gives you the possibility to propagete this value every time it changes.