[drupal-devel] [feature] Include top-level parent on book navigation block

Dries drupal-devel at drupal.org
Sun May 1 16:39:49 UTC 2005


Issue status update for http://drupal.org/node/20831

 Project:      Drupal
 Version:      cvs
 Component:    book.module
 Category:     feature requests
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  clydefrog
 Updated by:   Dries
 Status:       patch

The fact the block's title is repeated looks a bit awkward.  At the same
time, I see why this change would be helpful.


What if you have multiple books?  For the other links in the book
navigation block, all parents are shown so when multiple books are
available, the parent-link's behavior would be somewhat inconsistent. 
This isn't a problem per se given the parent is special anyway.


PS: have you seen http://drupal.org/node/14120?




Dries



Previous comments:
------------------------------------------------------------------------

April 19, 2005 - 07:51 : clydefrog

This is a patch to include the top-level book page in the book
navigation block. I think this makes the navigation block a lot more
useful. Before this patch, all pages in the book were included in the
block except for the root level page, so it was difficult to get back
to the root level.


I don't know if this is the best way to do it, but it works and affects
only book_tree() and book_block().




------------------------------------------------------------------------

April 19, 2005 - 07:53 : clydefrog

Attachment: http://drupal.org/files/issues/book.module_0.patch (1.38 KB)

Sorry... Here's the patch.




------------------------------------------------------------------------

April 19, 2005 - 18:54 : puregin

clydefrog, your patch breaks the default behaviour of book.module,
which is to allow multiple independent books.


In other words, there is - by design - no unique 'top-level book page'.


You probably want to create a book page to be a parent for all of your
existing pages; this will let you navigate via the book module block as
you desire.




------------------------------------------------------------------------

April 19, 2005 - 19:18 : bomarmonk

Can't you still have multiple, independent books and still show the root
page in the navigation block for these independent books?  Why not have
this flexibility?   I only know that if you are using the book
navigation for departmental information (for example) and you make the
first page of the department "board" (for example) the initial index
and information page will not display unless I use this patch.  Why
would I want it to behave otherwise?  What would I use this root page
to display?  Where? Perhaps I am not understanding why I would want
this root page to be invisible in my navigation block, since it would
be a starting point for all other pages in that book?   But then again,
I'm looking at the book module for possibly creating a hierarchal
structure for my entire website, and the navigation blocks for books as
a way to create structured navigation to this content.  Since taxonomy
does a poor job of presenting the browser with structured, static
content, this may be my only other option....  I'll keep trying to
understand all of the uses for these modules, but in the end I need
them to work for me and my purposes... of course Drupal is supposed to
have flexibility in this regard, but I'm finding that navigation and
menus for hierarchal, static conent isn't one of Drupal's strong
points.  Maybe a seperate module needs to find its way into the core
that accomodates such purposes?   I'm not sure: again, I'm still
learning, but this is becoming a rather difficult issue to "navigate"
(no pun intended- yeah right).




------------------------------------------------------------------------

April 19, 2005 - 19:51 : clydefrog

Re: puregin in #2


My patch still allows multiple independent books. When I speak of the
'top-level book page', I speak of the root page of an individual book.




------------------------------------------------------------------------

April 20, 2005 - 00:54 : clydefrog

Attachment: http://drupal.org/files/issues/book.module_1.patch (1.43 KB)

Here's an updated patch for HEAD. The earlier patch was against a
modified 4.6, so probably wouldn't have worked anyway.




------------------------------------------------------------------------

April 20, 2005 - 22:33 : bomarmonk

Should this patch work in conjunction with the other patch here:
http://drupal.org/node/1412 [1]? 


This other patch allows book blocks to appear on all pages as menus for
a site (not just menus for when you are already inside the book). 


Also, another thought on your patch: why not make the title of the book
itself be the link to the root page in the book navigation block? This
would make the menu block more efficient and it would seem to be a
logically sound modification-- no matter how these blocks are used.


Thanks again for your contribution to the book module-- I believe it
will prove quite valuable to those who want to use books to organize
and create menus for a hierarchal website.
[1] http://drupal.org/node/14120




------------------------------------------------------------------------

April 21, 2005 - 01:06 : clydefrog

bomarmonk, I answered your question in the forum. Please don't double
post.




------------------------------------------------------------------------

April 23, 2005 - 08:48 : puregin

Sorry for missing the point of your patch in my previous posting,
clydefrog.  Now that I'm clued in, I agree that it's useful to have the
parent listed in the hierarchy.  I'm not in a position to install the
patch yet, so I can't comment on how well it works.   One possible
quibble - this would add an additional level of indentation, which
might cause excessive rightward drift and 'squashing' of titles in the
display block.  Also, though it's not completely consistent or
intuitive, the parent title is presented as the book navigation block
title, so it's not completely 'missing'.




------------------------------------------------------------------------

April 27, 2005 - 02:01 : clydefrog

Attachment: http://drupal.org/files/issues/book.module_2.patch (1.56 KB)

It is true that this adds another level of indentation, but I don't
think it's enough to worry about. If things get crowded on your site,
you can modify your theme and you should probably consider rearranging
your book's organization. The parent's title is shown in the title bar
of the block, but it's not a link so it doesn't help with navigation. I
considered making it a link, but that would be inconsistent: no other
block has a link in the title.


The updated patch syncs with HEAD. It was generated with cvs diff -u;
hope that's all right.


Does anyone else have an opinion on this patch? Please give me some
feedback! Thanks.




------------------------------------------------------------------------

April 27, 2005 - 03:09 : puregin

I'm OK with the extra level of indentation.  (Just one more good reason
not to let book hierarchies get too deep!)


Djun




------------------------------------------------------------------------

April 28, 2005 - 02:45 : clydefrog

Attachment: http://drupal.org/files/issues/include_parent_book_tree.patch (1.71 KB)

Sorry, the last patch was broken.







More information about the drupal-devel mailing list