Active
Project:
Node Relativity
Version:
5.x-2.2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Mar 2007 at 18:06 UTC
Updated:
13 Apr 2008 at 17:43 UTC
I'm writing an action to be invoked upon child node creation... How could I refer and update a parent node's field (e.g. 'total').
Many thanks in advance.
Comments
Comment #1
andrew7 commentedI meant the php code for pointing to the CCK fields... Anybody?
Comment #2
darius commenteddevel.module is useful for such stuff.
Comment #3
darius commentedComment #4
(not verified) commentedComment #5
gaia commentedSorry, I have to reopen this issue. I can´t get this to work. Tried to implement this
$nid = 6;
$node = node_load($nid);
$parent = node_load($node->parent_node);
print $parent->field_some_cck_field;
in my template, but nothing appears in my content-type. Can somebody give me a hint, what i´m missing.
I also tried to embed a View with the Argument Type "Relativity: Parent Node ID" and my CCK Field, but this isn´t working either.
Any Help would be appreciated. Thank you in advance.
Comment #6
gaia commentedSorry, forgotten to change status
Comment #7
gaia commentedNobody? this is very important for me to finish a project. Any help would be appreciated.
THX in advance.
Comment #8
darius commentedprint $parent->field_some_cck_field;was not meant to be typed literally. Replace it with whatever field you need to access.Use devel.module for testing and running php code; using templates add another layer of complexity and makes it harder to find bugs.
Comment #9
Jeff Burnz commentedI found the above code gave me errors in node.module.
I recently used this code to print an image (imagefield field) from the parent node in all its children. I couldn't see how to get the value but the filepath and alt are there to grab. As mentioned above use the Devel module, its a great help.
Comment #10
Jeff Burnz commentedActually, in the end this is what I used...