[development] How to populate a content type programmatically - D7

Ernst Plüss ernst.pluess at gmail.com
Sat Jul 23 18:26:36 UTC 2011


Hi Drupal friends

In a cron job I'm loading data from an external source and want to
create nodes of a content type created with fields in D7.

For every node I do:

$node = new stdClass();
// populate field values
node_save($node);

How can I populate the filed values programmatically ? Is there
something in Field API that does this for me or do I have to rebuild
the whole complicated fields structure for every field by hand? Or is
there something that can prepare this structure in order I can fill in
my values?

Thanks for your help!
Ernst


More information about the development mailing list