By chandika on
Is there a way to create a CCK node programatically through another module? The CCK content type is already available, and all the required information for the fields are available.
Ideas?
Is there a way to create a CCK node programatically through another module? The CCK content type is already available, and all the required information for the fields are available.
Ideas?
Comments
This is an absolutely critical missing piece of functionality.
Please join the CCK group and help us fill the gap:
http://groups.drupal.org/content-construction-kit-cck
In essence, it should work like Views import and export, with a GUI code generator to help you do initial configuration, and a hook for reading the programmatically configured types.
Oh, wait. I just re-read your question and I'm going off on a different tangent.
In 4.7 when I wanted to programmatically create CCK nodes, I used print_r to inpect a built node, and then used that as a prototype for creating a programmatic node. Once you build the node (without an nid), send it to node_save.
In 5.0, you might be able to get the form for the node type, populate it, and submit it.
- Robert Douglass
-----
Lullabot | My Drupal book | My Digg stories
done!
I'll look forward to contributing.
Thanks for the post Robert.