The Book module's book navigation doesn't seem properly supported at the moment.

This is the css I added to style it in my subtheme. Hopefully it's useful for somebody.

.book-navigation {
	clear: both;
	padding-top: 1em;
	margin: 0 0 1em 0;
	}
	.book-navigation .nav {
		border-top: 1px solid rgb(229, 229, 229);
		margin-bottom: 3px;
		}
		.book-navigation .nav li{
			list-style: disc outside none;
			margin: 0 0 0 25px;
		}
	.book-navigation .page-links {
		border-top: 1px solid rgb(229, 229, 229);
		}
		.book-navigation .page-links .page-previous{
	    		text-align: left;
	  		width: 42%;
	  		display: block;
	  		float: left;
		}
		.book-navigation .page-links .page-up{
			margin: 0px 5%;
			width: 4%;
			display: block;
			float: left;
		}
		.book-navigation .page-links .page-next{
			text-align: right;
			width: 42%;
			display: block;
			float: right;
		}

Comments

markhalliwell’s picture

Component: User interface » Code

Please provide a patch.

mkrkarthi’s picture

Why we can't use bootstrap's inbuilt pager class?

<ul class="pager">
<li class="previous"><a href="book/page1">Previous Titile &rarr;</a></li>
<li class="next"><a href="book/page3">Next Title &rarr;</a></li>
</ul>
mkrkarthi’s picture

I don't know drupal theming.
But some hacks in book-navigation.tpl.php looks well.

<?php if ($tree || $has_links): ?>
  <div id="book-navigation-<?php print $book_id; ?>" class="book-navigation">
    <?php print $tree; ?>

    <?php if ($has_links): ?>

<ul class="pager">
      <?php if ($prev_url): ?>
        <li class="previous"><a href="<?php print $prev_url; ?>" title="<?php print t('Go to previous page'); ?>"><?php print t('&larr; ') . $prev_title; ?></a></li>
      <?php endif; ?>
      <?php if ($parent_url): ?>
       <li class="center"> <a href="<?php print $parent_url; ?>" title="<?php print t('Go to parent page'); ?>"><?php print t('up'); ?></a></li>
      <?php endif; ?>
      <?php if ($next_url): ?>
        <li class="next"><a href="<?php print $next_url; ?>" title="<?php print t('Go to next page'); ?>"><?php print $next_title . t(' &rarr;'); ?></a></li>
      <?php endif; ?>
</ul>

    <?php endif; ?>

  </div>
<?php endif; ?>

Kindly provide a patch to implement properly from theme / sub-theme.

mkrkarthi’s picture

Version: 7.x-2.x-dev » 7.x-3.0-rc2
Issue summary: View changes
Simon Georges’s picture

Version: 7.x-3.0-rc2 » 7.x-3.x-dev
markhalliwell’s picture

Title: CSS improvements for Book navigation » Support book.module
Version: 7.x-3.x-dev » 8.x-3.x-dev
Assigned: Unassigned » ryan.armstrong

Committed 686420e to 7.x-3.x:

Issue #2034927 by Mark Carver | peteruithoven: Support book.module.

markhalliwell’s picture

Committed b13148f to 7.x-3.x:

Issue #2034927 by Mark Carver | peteruithoven: Support book.module.

Removed btn-small class from outline button.

markhalliwell’s picture

Status: Active » Needs review

  • Commit 686420e on 7.x-3.x, 8.x-3.x by Mark Carver:
    Issue #2034927 by Mark Carver | peteruithoven: Support book.module.
    
  • Commit b13148f on 7.x-3.x, 8.x-3.x by Mark Carver:
    Issue #2034927 by Mark Carver | peteruithoven: Support book.module....
jjancel’s picture

Assigned: ryan.armstrong » jjancel

Hello Mark
how to use this patch for Book navigation block, the special block that is created by the Book module.
you have arrived at a workable solution?

markhalliwell’s picture

Assigned: jjancel » ryan.armstrong

@jjancel, it's in the latest 7.x-3.x-dev download as well as 7.x-3.1-beta1.

  • Mark Carver committed 686420e on 8.x-3.x.x
    Issue #2034927 by Mark Carver | peteruithoven: Support book.module.
    
  • Mark Carver committed b13148f on 8.x-3.x.x
    Issue #2034927 by Mark Carver | peteruithoven: Support book.module....
markhalliwell’s picture

Version: 8.x-3.x-dev » 7.x-3.x-dev
Assigned: ryan.armstrong » Unassigned
Status: Needs review » Closed (fixed)

I'm just moving this back to 7.x. If this needs re-evaluation in 8.x, create a new issue.

roblog’s picture

Thanks for the css code .. very helpful

dadderley’s picture

I am re-theming a site with a huge support section.
This content is was created as one big book. The book navigation block is how this content is navigated.

But, this book navigation block only shows one level in my bootstrap sub-theme, so it is totally unusable.

This thread indicates that other people have bumped into this problem previously and that there might be some solution.
What am I missing? Can someone please tell me if there is a solution for this.
I am using Bootstrap 7.x-3.5

Thanks

tvaughn78’s picture

Just want to comment that when I updated from 7.x-3.0 to 7.x-3.5 recently, my users found the new book navigation totally unusable (the entire book in a dropdown button labelled Outline). I think the change was just too much for them. I deleted the bootstrap book template files and things are now as they were.

In any case, big thanks to markcarver and the other devs of this project; it is generally quite powerful and a pleasure to use!

logicp’s picture

Greetings! I'm having a similar issue using Bootstrap 7.x-3.5 as part of WETKit 4.10.

digitaltodd’s picture

I've had the same issue. The outline book navigation icon is note very useful either. Disabling the template files as in #17 and adding the CSS at the top to my injector makes books behave "normal" again.

Andru’s picture

Same problem as #15 to #18. Menu just displays as a collapsed block with an icon, a caret, and the word "Outline" in lower right of each book node, including the main book parent node where you would expect a table of contents to be visible. Book menu block in sidebar similarly is a collapsed block, not showing nested sub-items in either case. Bootstrap 7.x-3.5 on D 7.50.

Deleting the book template files fixes the menu on the page, but not the Book module's menu block.