I absolutely love the categories module! I used the wrappers to convert a book I had created into categories, and it worked great.
One thing is missing though: With the Book, I had a lovely "Navigation Block" that appeared only when the Book was being looked at. It was much easier to use than the TOC-style menus that appear below the content, thus is very important to me.
I have played with virtually every setting everywhere and I cannot figure out how to get a Block like this back! It actually seems like it should be a rather obvious feature of the Categories module or content-type, because it really is a great feature of the Book module that Categories aims to replace (hint hint developers).
Can anyone tell me how to achieve this? Thanks very much.
Comments
This might be getting toward what you are looking for
How to make a book navigation block appear on all pages: http://drupal.org/node/44648
Possibly if book is still enabled these functions might work, with any given node? Otherwise, if they aren't there already there but well hidden, these book functions called to make the navigation block need to be ported to Category.
Anyhow that thread at least points to what Book functions need to be replicated. I hope developers with more time pick up on this. Eventually I'm going to be writing and putting my thesis on-line and I'll need a very good book-style system for that, and haven't been able to tell whether book or category is the way to go yet, or if something else might be an option.
(Related, the apparent ability to move around many small sections of paragraphs in a book, if one structures it that way, which will remain at a constant node id make Drupal exciting for consistency of links even in academic works-in-progress. One wouldn't want these sections each on their own page though.)
I look forward to all book-like developments.
~ben
web developer, http://agaricdesign.com/
person who gives a damn, http://pwgd.org/
benjamin, Agaric
I'm with you on this.
I'm with you on this. Supposedly you can do what you want by enabling the category_legacy module. However this requires a patch be applied to the book module, and on my install the patch did not take. YMMV.
The previous poster's reply would be useful, but category and book modules do not peacefully co-exist. (they both use $node->parent).
It's a shame, really. You should post this as a feature request on the category module, if its not there already.
the patch did not work for me either
i actually just coped the wrapper files into the root modules directory and renamed the original book and taxonomy modules for backups. the auto-install of the wrappers did not work, but this method worked fine.
unfortunately, since i have installed the wrappers, there is no way that i can get the old book navigation blocks back...
i'm really quite surprised that this functionality wasn't inherently present in the category module, since it is such a strength of the book module. instead, categories wants to keep adding menu items to primary links or navigation menus. i can't even get it to push the menu items to a custom menu!
i will search the feature requests for this and submit it if it's not already there.
thanks!
I need this too
I just installed the Category module because I figured it would help streamline the process of building my taxonomy, menus and navigation as I post content to the site, and I'm really disappointed that I have lost my book navigation.
I basically have one menu, Primary Links, which contains all the navigation for the site. Users really only see the first and second levels of this menu as navigation bars at the top of the page using drupals built in primary links and secondary links features which pull the links out of the menu.
When a user is inside a section, identified as one of the primary links, then they should also be presented with a sidebar navigation for all the content within that section, which is where the book navigation block was perfect, but now that Category module is installed, it has disappeared.
What is the easiest way to include this on all pages of the site?
Is there a way to include just a branch of a menu? That would work perfectly as well, if I could simply display the menu from the second level down.
Here's an example, in case the above isn't clear:
the menu:
Home
Programs
- program 1
- - program 1 detail 1
- - program 1 detail 2
- - program 1 detail 3
- program 2
- program 3
- program 4
- program 5
About Us
- Mission
- Goals
- Staff
Lend Support
- Donate
- Volunteer
Learning Center
News & Events
------------------------------------------------------------
So, at the top of the site, I have my primary links navigation bar which shows:
Home | Programs | About Us | Lend Support | Learning Center | News & Events
and if the user is in the Programs section, the I want a sidebar with the following navigation:
Programs (this is just the name of the block, which is the same way the book module handled it - not a link)
- program 1
- - program 1 detail 1 (items could optionally be expanded, based on the setting in the menu)
- - program 1 detail 2
- - program 1 detail 3
- program 2
- program 3
- program 4
- program 5
Each section will then have it's own sidebar navigation, which is just generated off the second level of the menu, matching the section which the user is within. The homepage has no sub sections so no sidebar navigation would be present.
---------------------------------------------------
So, doesn't anyone know the best/simplest way to acheive this?
Thanks alot ...
Michael
www.webemulsion.com
A Great Solution
Here's a solution I have come up with for this problem that works very elegantly.
My Category pages now have a book style TOC block.
Here's the snippet I used. Just paste this in a new block and specify PHP as the input format and tell it which pages you want the block to display on. Using path_auto makes it easy to generate pages that reflect the menu system, which allows you to specify the first part of the url as the options for where the block should display, such as specifying "programs*" to have the Programs TOC display on all Program pages.
Replace 10 above with the node id of the node which represents the top level of the menu tree that you want to display. You can see this by hovering over the edit link on the nodes page and looking at the staus bar.
With this method you have to create a block for each section that requires a TOC menu navigation. It wouldn't be too difficult to modify this to work universally by analyzing the path, but I didn't need this or want to spend the extra time right now.
Unlike a menu, it will inheret the features you set for the TOC in the Category module options, such as displaying a count of associated nodes, and have a depth of the TOC, so items can be expanded or not.
NOTE: the category_display_toc() function is a part of the Category Module and requires category display module to be enabled. It's defined in modules/category/category_display/category_display.module on line 312.
Hope this helps everyone ...
If you want to discuss this, I've created a PHP Snippet page for it here, so it's probably better to enhance this code ther instead of in this thread.
Michael
www.webemulsion.com
Great work!
I am glad that there has been so much response for this request. Thanks Mikey for the snippet!
I also want to point out that there was a feature request put in to the Category project page that has also garnered some response. I want to link all of these together so that everyone involved can see the work being done on various fronts, and hopefully get everything into the core Category module for a release.
Thanks much to everyone!
Help me out
Hey Michael,
After emplementing your snippet I get the following error message:
Fatal error: Call to undefined function: category_display_toc() in /home/ladipp/public_html/includes/common.inc(1201) : eval()'d code on line 4
Can you or someone help me out.
Thanks.