By Summitt Dweller on
Seems simple enough...
I have a custom content type and when a user created a node of this type I would like to auto insert it into a specific, pre-determined Book structure. In the past I've given users permission to do this themselves using the common "outline" fieldset, but some of them find my instructions lacking (imagine that) and are easily confused by all the choices they have.
The site in question uses books extensively and the parent book page they need to select is a couple levels deep and not near the top of the overall book outline.
Anybody know the Book API well enough to suggest some code (or a contributed module) that will do the trick? Thanks in advance.
Comments
I'm just wondering if using
I'm just wondering if using the book module is the best way to achieve a "Book structure" in this case. Since you are already creating your own content type, it seems like you might have better luck using taxonomy or even just the menu system to achieve a similar result.
Using All Three
I am already using Book, Taxonomy and Menu all in combination (plus NAT and some Views2 code embedded into the node-.tpl.php file for my custom content type. The missing link in the whole affair is that I can't auto-insert a new page into a target book... apart from letting the user or a site administrator do so manually. Otherwise it all seems to work very well together.
hook_form_alter
I think I'm going to look at my override to hook_form_alter and see if perhaps I can just hide the book outline fieldset and inject the response values I'm looking for into the form there. I'll reply back if it works... maybe even with some details.