Posted by pcorbett on June 25, 2007 at 8:51pm
Does anyone know of a standard way of creating a new node (a page node, for example) through code? I'm creating an installation profile and wanted to check before I go to inserting values directly into the DB.
Comments
Here's an example for 4.7
Here's an example for 4.7 which I think should still work:
http://drupal.org/node/60479#comment-114666
Yes, this is it
I came across node_save() last night and it looks to be what I'm looking for. Thank you for this. Also, if people need to do this and have menu items that need to be linked to, using the path_set_alias() function will insert values into the DB associating an alias to a node.