Description

Book Outline Block provides a single block that displays the Table of Contents of the current book (if the current menu item is indeed part of a book).

This module is similar to http://drupal.org/project/bookblock. But Book Block requires you to create and manage a separate block for each book. This module provides one block that automatically displays the ToC of the current book. The block is not visible on non-book pages.

The need for this module was discussed on StackExchange here: http://drupal.stackexchange.com/questions/61046/how-to-create-a-menu-for...

Links

This is a Drupal 7 module.

Reviews of other projects

CommentFileSizeAuthor
#16 bookoblock_module.png79.96 KBmaxneaga
#16 book_module.png51.75 KBmaxneaga
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

klausi’s picture

Status: Needs review » Needs work

Welcome,

please get a review bonus first. Then try to fix issues raised by automated review tools: http://ventral.org/pareview/httpgitdrupalorgsandboxbalsama1929616git

davidsonjames’s picture

Just a couple of things from looking over this module. You have a .uninstall file with your hook_uninstall call, this file will need to be renamed .install instead.

I think your module will need to have a dependancy on the 'block' module. And you still have a master branch, you should get rid of that and then change your default branch in your version control tab of your project page.

balsama’s picture

Thanks so much for both of your feedback.

Changes:

  1. Zero errors and zero warnings about coding standards (Note that I have now installed PHP_CodeSniffer and the coder module in my dev environment, so I won't have to commit to test in the future)
  2. Renamed .uninstall file to .install
  3. Deleted Master and 8.x branches and set 7.x to default
  4. The module now has a dependency on block as well as book.
balsama’s picture

Status: Needs work » Needs review

Setting status back to needs review.

bulat’s picture

Status: Needs work » Needs review

I suggest few minor changes:

1. Replace bookoblock_is_book_node function with book_outline_node_book:

function book_outline_node_book() {
  $node = menu_get_object();
  if ($node && isset($node->book)) {
    return $node->book;
  }
  return FALSE;
}

2. use $book['menu_name'] instead of book_menu_name($book['bid']);

3. I need to massage array I get from menu_tree_output. I did not find a hook to do this. May be you could add a hook, that will help to extend based on your module. Now I had to copy your code and insert a call to custom function that modifies link titles.

Hope this helps and good luck with this module.

Noe_’s picture

Status: Needs review » Needs work

Based on what bulat said above I changed the status back to needs work.

But other than that it looks good to me.

balsama’s picture

Thanks for the feedback bulat. I've committed the suggested changes for #1 & #2. For #2 I didn't change the function name as I didn't want to deviate from the established bookoblock... standard.

#3 is a great idea, but more of a feature request. Hopefully this will be approved as a full project and we can add #3 back in as such.

balsama’s picture

Issue summary: View changes

Added other project review link

bulat’s picture

Commit looks good. Thanks.

for #3 I have added comment to show what exactly I wanted to achieve with hook - http://drupal.stackexchange.com/a/65814/9753

Possibly there is another way to do that without custom hook.

balsama’s picture

@bulat the output is rendered with menu_tree_output(). There is no issue here. If you want to submit this as a feature request after it gains full project status you are welcome to.

bulat’s picture

Sure, I am new to review process, hope you are not waiting on me, cause I am happy with the code.

bulat’s picture

Status: Needs review » Reviewed & tested by the community
klausi’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Sorry for the delay, make sure to complete your review bonus as strongly recommended in the application documentation.

I don't understand why we need this module - I can just use book.module's block, configure it to "Show block only on book pages" and be done with it? Then the block will only show up on book pages and it will only show the current book outline. What am I missing?

balsama’s picture

Honestly, I don't think I, or the original requester, ever realized that the core book block had the option to display only the current book's outline.

This module does have more advanced configuration options (depth, top-level linking) but I doubt that warrants a new module.

Let me spend some time tomorrow confirming this, and thanks for your feedback. I can't believe something so obvious might have unnoticed.

balsama’s picture

It looks like you're right. I have confirmed that the core book module provides 90% of this functionality.

What's the process here? Close this issue I assume? And delete the repo? The added functionality is pretty trivial, so I doubt it's anything that would ever be added to core book.

klausi’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Yep, let's close this application. Feel free to get back to us anytime whenever you have a new project that you want to promote.

Deleting the sandbox is totally up to you, as you like it.

klausi’s picture

Issue summary: View changes

Updated PAR review list

maxneaga’s picture

Issue summary: View changes
Status: Closed (won't fix) » Needs review
FileSize
51.75 KB
79.96 KB

The core book block does not show an expanded tree:
core book block

while this module does:
bookoblock block

Is there any chance to have it approved as a module in the future?

PA robot’s picture

Issue summary: View changes

Fixed the git clone URL in the issue summary for non-maintainer users.

I'm a robot and this is an automated message from Project Applications Scraper.

yogeshmpawar’s picture

Title: Book Outline Block » [D7] Book Outline Block

Adding D7 to title

klausi’s picture

Status: Needs review » Closed (won't fix)

This application is closed because the module is not necessary.