Hello, did anybody know how to add child page to book programmatically in drupal 6?
Thx.
Under drupal 5 it was quite easy to do :).

Comments

sunwarior’s picture

nobody knows :( ?

sushyl’s picture

I need code snippet to add child book page to an existing book. Anyone knows how to do this?

-
Cheers!
Sushil H

sushyl’s picture

I did it by following code. Still struggling with it.
can anyone figure it out?

$node = new stdClass();

// for existing node use following code 
// $node = node_load($nid); 
Global $user;
				$node->uid = $user->uid;
				$node->title = 'Node Title here';
				$node->body = 'Body Content here';
				$node->field_cck_filed_name[0]['value'] = $issue->year;
				$node->book['bid'] = $result; //book id of parent node

I could not find out how to order the nodes. (i.e. Prev and next)

-
Cheers!
Sushil H