[development] Proper way to programmatically modifying a CCK node's nodereference field in 4.7

Rob Barreca rob at electronicinsight.com
Thu Sep 21 18:27:54 UTC 2006

Can anyone with some CCK knowledge point me in the right direction with 
this? Just trying to manually add node's to a CCK nodereference field.


Rob Roy Barreca
Founder and COO
Electronic Insight Corporation
rob at electronicinsight.com

Rob Barreca wrote:
> I want to programmatically add related blog postings references to a 
> CCK node's nodereference field called field_related_blog_posts. Would 
> something like this be the proper way to do this in 4.7? I know the 
> fapi pull in 5.0 would help with this.
> $node = node_load(5);
> $node->field_related_blog_posts[] = array('nid' => $blog_nid, 'view' 
> => '<a>..</a>');
> node_save($node);

More information about the development mailing list