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.
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
- Project page: http://drupal.org/sandbox/balsama/1929616
- Repo: git clone --recursive --branch 7.x-1.x https://git.drupal.org/sandbox/balsama/1929616.git bookoblock
This is a Drupal 7 module.
Reviews of other projects
Comment | File | Size | Author |
---|---|---|---|
#16 | bookoblock_module.png | 79.96 KB | maxneaga |
#16 | book_module.png | 51.75 KB | maxneaga |
Comments
Comment #1
klausiWelcome,
please get a review bonus first. Then try to fix issues raised by automated review tools: http://ventral.org/pareview/httpgitdrupalorgsandboxbalsama1929616git
Comment #2
davidsonjames CreditAttribution: davidsonjames commentedJust 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.
Comment #3
balsamaThanks so much for both of your feedback.
Changes:
Comment #4
balsamaSetting status back to needs review.
Comment #5
bulat CreditAttribution: bulat commentedI suggest few minor changes:
1. Replace
bookoblock_is_book_node
function withbook_outline_node_book
: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.
Comment #6
Noe_ CreditAttribution: Noe_ commentedBased on what bulat said above I changed the status back to needs work.
But other than that it looks good to me.
Comment #7
balsamaThanks 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.
Comment #7.0
balsamaAdded other project review link
Comment #8
bulat CreditAttribution: bulat commentedCommit 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.
Comment #9
balsama@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.
Comment #10
bulat CreditAttribution: bulat commentedSure, I am new to review process, hope you are not waiting on me, cause I am happy with the code.
Comment #11
bulat CreditAttribution: bulat commentedComment #12
klausiSorry 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?
Comment #13
balsamaHonestly, 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.
Comment #14
balsamaIt 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.
Comment #15
klausiYep, 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.
Comment #15.0
klausiUpdated PAR review list
Comment #16
maxneaga CreditAttribution: maxneaga commentedThe core book block does not show an expanded tree:
while this module does:
Is there any chance to have it approved as a module in the future?
Comment #17
PA robot CreditAttribution: PA robot commentedFixed 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.
Comment #18
yogeshmpawarAdding D7 to title
Comment #19
klausiThis application is closed because the module is not necessary.