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.
The depth of the book navigation block could be configurable thru a block configuration setting.
I will try to implement that asap.
Comments
Comment #1
mansion CreditAttribution: mansion commentedI developed my own block so don't need this feature anymore.
Closing it.
Comment #2
erok210 CreditAttribution: erok210 commentedI'm a newbie to Drupal. I've been trying to learn how set the depth for the book.module. I can't seem to find a way to set this under the "configuration" settings area.
Right now the book navigation block expands as I go deeper into the book pages. I'd like to stop at the chapter level.
- Book
--Chapter title level <- stop here.
---Page title level
I assume I have to modify the php code in the book.module file, but I need specific details on what to modify. I tried changing "book['depth'] < MENU_MAX_DEPTH)" to "book['depth'] = 2) , but I didn't see any change in behavior:
LINE 55:
if ((user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && $node->book['depth'] < MENU_MAX_DEPTH) {
Comment #3
erok210 CreditAttribution: erok210 commentedFound a PHP snippet that helped.
Comment #4
pyxio CreditAttribution: pyxio commentedHello,
I am trying to do the same thing. Can you please share the php snippet you used to solve this? thanks. Kevin
Comment #5
hazah CreditAttribution: hazah commentedCan anyone recommend how to approach this in Drupal 7? While the book module is invaluable for organizing content, it would make sense to have a more fine tuned control for something of this nature. I do think that a feature such as this should cover more than one case per site. That is, different books should be able to have their own configuration for this. Anyone has further thoughts on this topic?