Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By dmclark on
Hi,
I have not been able to find this anywhere.
I want to creata a table of contents for a book by expanding all children recursively.
Comments
This seems to work (change
This seems to work (change the 1 on the last line to the book number).
I just copied the book functions which print a non-expanded tree and removed the unfold argument.
Better solution
Apply this patch to modules/book.module (Drupal 4.6):
This changes the display of the list of children at the bottom of each book page to include sub-sections.
Does anyone has patched version for 4.7.3?
Thanks!
This one shows all revisions
Hi!
I like this, but how to hide all revisions use this program? Thanks!
Daniel
Change $result
Change $result from
to
This works on my site (4.7.3). A little late but I ran today into this problem and when I search on TOC and book this is the first topic on the list so an update could be handy.
Book plus...
If you don't want to hack into your module, try going through my homepage to get a copy of "book plus" - it has admin settings for tables of contents, including an interactivity option (to expand/contract tables of contents via javascript).
I'll be checking out Book Plus
I'll be checking out Book Plus first chance I get. Have you considered posting this on drupal.org? It seems like a most worthy addition.
Because it replaces...
Book Plus replaces book.module completely - this is done by design so that you can transform the view and edit screen presentations instantly without having to change their content types or make database alterations. It's a non-destructive, 1:1 switch. However, I believe that offering one module to replace another would not be well received. I've been asked to make a patch that can be applied to the original book module, but there are SO many changes now - the patch would be to delete everything and insert the new code! Rather than extinguish more flames about how I shouldn't offer altered core modules as add-ons, how book is dead because it's an inferior content type, etc., so forth, I've just opted to maintain it independently for now.