Active
Project:
Node Hierarchy
Version:
6.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Nov 2009 at 00:43 UTC
Updated:
15 Nov 2010 at 13:16 UTC
In search of a code snippet that does the following: I have a parent node. It has some child nodes with Node reference fields. When I create a child node of a given parent, I want to have that child's node reference field to be automagically populated with a reference to the parent node.
I tried writing some php in the CCK node reference field's default value, but the CCK did not like my syntax. Someone out there must have done something like this before. Thoughts?
Comments
Comment #1
buzzman commentedany updates for this? bump ...
Comment #2
Jorrit commentedI'd like to have this as well. I have a Customer CCK type and a Portfolio CCK type. There is a Node Reference field called Customer in the Portfolio type, referencing Customer 1 node. It would be nice if the parent-child relationship would be automatically set to the selected Customer.
Comment #3
TimelessDomain commentedCreate node references for each content type (if within a single content type then create 2 node reference fields : child & parent). Then sync/ link these node reference fields with corresponding node references module http://drupal.org/project/cnr