Posted by Parkes Design on July 13, 2009 at 3:20pm
Jump to:
| Project: | Node Relativity |
| Version: | 6.x-3.x-dev |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hi firstly great module, it has been very useful for me.
I have a question, how would I go about populating a child node cck field with a parent node field data?
Say that the parent node's content type is Job Details and it collects information about the job like address etc and the child node's content type is Inspection and it collection information about an inspection but also has duplicate information from the parent node. Is there a way to auto populate the fields without using the prepopulate module that allow users to see sensitive information in the url and browsers history?
Thanks any help would be appreciated.
Comments
#1
Is there a way to achieve this? any suggestions?
#2
I 'm also interessed in doing this
#3
Terry... I found another solution by not using node relativity but a combination of modules to achieve the same result. Node Relationship, node ref url and rules.
#4
I was able to add the parent node to the child doing this:
Create a field in the child content type,
Under 'Default Value', PHP code add:
$parent = is_numeric(arg(4));
if($parent == true){
return array (
0 => array ('nid' =>arg(4)),
);
}
#5
I create a field in the child node (text), and put the code as the default PHP value. I got this error:
"The default value PHP code returned an incorrect value."
#6
hi --- how did you get this to work?
#7
This is my problem:
I have created 3 content types - Company, Content1 and Content 2. A user creates a Company. The user can also create Content 1 and 2; these are automatically associated with Company. Here is the usage I am having difficulty implementing:
When the authorized user creates a content 1, the company name sbould be automatically prepopulated on content 1 - Content 1 is a child node to the Company node.
I tried using Node reference Url on the field in Content 1 (to rerence name from Company), but the best I could get was a list of all availbable companies - and I would rather just return the appropriate company name.
The difficulty I am having with above cascades down to my second challenge. I would like to create Content 2 (Content 2 is a child node to the Content 1 node) with two prepopulated fields - name from Company and the title field from Content1.