2

I am creating a custom form which creates new nodes of type 'book'. I have been able to get the "book outline" to render on my form using

$nid = $node->nid ='nid';    
module_load_include('inc', 'book', 'book.pages');
book_outline_form($form,$form_state,$node);
_book_add_form_elements($form,$form_state, $node);

My issue is when i select the drop-down for Book, it does not have "create a new book" as an optionenter image description here

Can someone help me with this issue? Has anyone experienced this before?

1

I got it to work! My issue was that $nid = $node->nid ='nid' should have been set to $nid = $node->nid ='new'.

I also added module_load_include('inc', 'book', 'book.pages'); to call the function book_outline_form();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.