29
Oct
How to build a node in Drupal programmatically
<?php
$newnode = new stdClass();
$newnode->title = ‘Welcome’;
$newnode->body = ‘This is the welcome page for your site. Replace this text with whichever content you\’d like to use for your welcome page.’;
global $user;
$newnode->uid = $user->uid;
$newnode->type = ‘page’;
$newnode->status = 1;
$newnode->promote = 0;
node_save($newnode);
?>
From http://mediumexposure.com
Technorati Tags: Drupal node, Drupal, Programming
Popularity: 9% [?]
Popularity: 9% [?]

