Hi,

I would like to see an easy way to get the lovely navigation blocks that book.module provides while browsing each book. Perhaps there is a way to get something similar set up using the menu options for the categories and sending them to a custom menu, but i cannot for the life of me get it to work.

I think that these navigation blocks should be present in a default installation of the category module, since they make navigation much easier than the bottom-of-the-page TOC navigation. I was surprised that there was not an easy way to get these book-style blocks back into action without getting frustrated with all the menu options for various containers and categories.

Another option would be to give control over where the TOC appears, and allow the TOC to be sent to a block rather than (or in addition to) appearing below the content.

If I am wrong in suggesting this, or if someone can tell me how to get these results via the current module's menu settings, then by all means let me know!

Thanks for such a great module!

Comments

venkat-rk’s picture

If you have a container and category dedicated to book pages, you can simply create a menu at ../admin/menu and move all the relevant category and cotainer links to that menu and you have your block. Be aware, though, that this will probably break the prev|up|next navigation or the breadcrumb trail- I am not sure which.

Alternative, see if this tutorial gives you what you want:
category.greenash.net.au/multiple_root_menus

venkat-rk’s picture

fluitfries’s picture

If you have a container and category dedicated to book pages

I am not sure how to dedicate a category to book pages... i was under the impression that i would no longer need to use any book pages because category replaces such a need. Most the nodes that used to be book pages are now CCK types that have been inserted into the category structure, which is much better!

I read through the tutorial, it seems like it may be able to solve the problem, aside from a few catches here and there. The only problem i have is that the structure is already created, with a container at the root, and it is not a hidden container. Do i need to use the "dual-root" type of setup that was shown in the tutorial?

The other feature that might be missing is that the old, book-style menu blocks would only appear if you were viewing content from that book. Is there a way to duplicate that?

Thanks for your reply.

venkat-rk’s picture

I am not sure how to dedicate a category to book pages... i was under the impression that i would no longer need to use any book pages because category replaces such a need.

You're right, I forgot that.

AmrMostafa’s picture

Assigned: Unassigned » AmrMostafa
StatusFileSize
new5.88 KB

Hello,

I've wrote a category_block module, which should give what you are asking for. A tar.gz of the module attached.

The module doesn't only give navigation blocks for categories, but tries to solve the problem of the block visibility scope while browsing a category or even a node that is classified under a category (e.g. a node that is not a category nor a container).

I'm very open for crits and suggestions for improvements.

Needless to say, this module is considered to be in early development.

Bodo Maass’s picture

The installation file (category_block.install) doesn't work because it has two typos: 'module_exists' should be 'module_exist' (lines 3 and 6), and 'category_displau' should be 'category_display' (line 6).

Thanks for the initiative to port the book-navigation block to category!

Bodo Maass’s picture

When I'm trying to create a block, I get this:
user warning: Unknown column 'visiblity_control' in 'field list' query: INSERT INTO sygyt_category_block (bid, cid, name, description, depth, visiblity_control) VALUES (2, 34, 'Documentation block', 'Doc_block', 0, 0) in mydrupaldir\includes\database.mysql.inc on line 120.

I guess the installer didn't quite create the correct table.

AmrMostafa’s picture

oh, Thanks for pointing that out :-) an updated roll is on the way..

AmrMostafa’s picture

StatusFileSize
new5.89 KB

Alright, fixed both issues, and some other typos on the way.
Attached new release..

AmrMostafa’s picture

You will need to do:
DELETE FROM system WHERE name = 'category_block';
DROP TABLE category_block;

Then re-enable the module, in order for the .install to get in action :-).

fluitfries’s picture

Glad there is work being done on this! Is it going to be merged with the core Category project soon?

I also want to point out that there was a sister thread and susequent snippet created to solve this problem. I want to link 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!

OpenChimp’s picture

I wanted to point out that there are some disadvantages to using the snippet referenced above. It simply prints the category navigation tree for a given branch of the tree, using the settings for that container or category. The problem I had with this is that when used to print navigation, the branches/leaves of the navigation tree don't open and collapse as you move through the tree the way the menu does.

I wanted to be able to use different (longer) names in the sidebar navigation than what was showen in the menu, but ended up not being able to do this.

So ... for now, my solution to get navigation working my pages is using path_auto to get nicely constructed urls and I build a custom block for each section of the site which displays a branch of the main site menu. My "Primary Links" menu contains links to all pages in the site, which allows it to generate the Primary and Secondary links, while it can also be used for the section navigation by calling the specific branch of the menu.

Best of both worlds

Another related problem I've been having is that the Category module renames my menu items when the pages are updated. ie. I have a page called "Advocate Training Program", which I want to call ATP in the menu, but if I edit the page, Category module renames the menu item. Here's some features I'd like to see:

  • maintain menu item name seperately from page title
  • branch the menu according to current location (like menu lists)
  • display node count (like Category TOC)
  • toggle display node count (like Category TOC)
venkat-rk’s picture

I wanted to be able to use different (longer) names in the sidebar navigation than what was showen in the menu, but ended up not being able to do this.

Go to ..admin/menu, click on the edit link of the categories/containers you want to give a different name, change the name and save the changes. Your navigation menu will now have the new names, but your container and categories will have their original names.

Do be aware that if you edit the container, you will lose these changes and need to make them again.

AmrMostafa’s picture

Next week I will try updating my module that I posted above to have solutions for the problems you posted. So expect another release soon ;-).

fluitfries’s picture

I was just thinking that since every output of Category is supposed to be a themeable function, couldn't we just tell the TOC to be moved to the sidebar? The default TOC has some fine features, but it would be nicer in a sidebar than on the content itself. If anyone knows how to do these please inform! Thanks. :)