Posted by estimi on January 26, 2011 at 4:08pm
Hello,
I'm using the "Add new content" action to create three different nodes based on the information provided during the creation of another node. Unfortunately, i'm not able to populate the "Body" field of the new nodes. I'm only able to set their title and populate CCK fields. Is this a bug? A lacking feature? Any idea on how to fix this?
Thanks in advance, guys.
Comments
use custom php
use custom php snippet
$new_content->body = 'the body';return array("content" => $content);
Where should i put that PHP
Where should i put that PHP snippet? Should i build a new action? If so, how can i do that?
if you have php filter
if you have php filter enabled (in admin/build/modules), you should be able to make a custom php action.
tried this but it didn't work
the body of my new node wasn't populated.
After My "Create an entity" action (where I populate the title and author)
I created an execute php code action with:
<?php$new_X_node->body = 'the body';
$new_X_node->field-tag1 = 'test1';
$new_X_node->field-tag2 = 'test2';
$new_X_node->field-tag3 = 'test3';
return array("content" => $content);
?>
Also, first tried it without my term fields and it didn't work either way.
Could you give it some more thought? I'm sure your right, but is there a glitch in this code? Something missing?
x
x
DefaultTextForNode
The following module is able to do that. Maybe some of its code could be recycle. http://drupal.org/project/DefaultTextForNode
---
How to contribute to Drupal.