Hi,
I use this theme a lot cause the flexibility.
In drupal 8 i want to report that the book navigation at the bottom page menu to go to previous, Parent and Next page are not display inline, i think it should be display inline, may be next beta will be fixed.
Thanks.
Comments
Comment #2
markhalliwellThis really isn't a priority at the moment. In fact, I'm tempted to not even put much effort in styling this as no one really uses the book module that much since it's just as easy to do a custom node type and a custom view.
edit: I'd be willing to entertain patches if someone submits them, but I'm just saying that I personally am not going to spend time on coding it.
Comment #3
yukare commentedI do not know how to make a proper patch to bootstrap, but i use this from bartik in my custom theme. I hope someone use this as base for a proper patch.
templates/book-navigation.html.twig
And add this to style.css:
Comment #4
cof6656 commentedJust stumbled across this and thought I'd share my solution although the issue is a little older for anyone who's still interested:
Actually you just need to add the class "pager" to
<ul>and classes "previous" and "next" to the first and last<li>element. Bootstrap 3 has styles for pager list items included, read more on w3schools. The<li>element for the 'Up' link will be centered automatically.So below your comments in book-navigation.html.twig:
But if you want you cann add a class ".book-nav" to your style.css:
This just adds a border to the top and bottom plus a little padding to help distinguishing between navigation and content.
Comment #5
markhalliwellMy sentiments from #2 are still present.
The primary reason: the book module (a very old core module) is still using its own custom theme hooks instead of using other existing, more established, and proper theme hooks with
__book_*suggestions (e.g. #2461691: "book_tree" template suggestion should be "menu__book__").Once it does, then this stuff will be themed "automatically" because this project covers the core components.
Supporting antiquated core modules like this aren't really the primary objective of this project.
If you're site really "needs" this, then it's a simple addition to a sub-theme as pointed out above.
Comment #6
rwilson0429 commentedReally? So, there are some "antiquated core" modules in Drupal 8? Can't imagine why they would put "antiquated" code in what is billed as "biggest update in Drupal's history". Since Book is a core module, I'm wondering where the stat came from that suppose to show that "no one really uses the book module". I see lots of sites using the Book module. Bootstrap is such a wonderful theme, I hope you will reconsider making the Bootstrap theme play well with w/D8 core modules, such as Book.
Comment #7
leventdal commentedI am not sure what is causing this (theme or module) but this is looking horrible and I couldn't hide from anywhere.
In H2 format there is a "traversal links for" book message displayed. The book navigation links aren't even properly ordered.
https://imgur.com/a/yZ8Fr
The book helper plugin should have been able to remove it but I guess that is obselete for 8.x
Comment #8
rwilson0429 commented@leventdal , create a book-navigation.html.twig template file in your subtheme's template folder and copy and paste the code from #4 into it. This should take care of the "traversal links for" book message displayed. The code adds a class named "visually-hidden" to the h2 tag which should hide the "traversal links ..." being displayed.
Comment #9
leventdal commented@rwilson0429 thanks for the info. I switched to another theme based on bootstrap and created a subtheme off of it. That solved the problem probably it contains this template.
Comment #10
mathieso commentedThis worked for me. Hope it helps someone.
In a custom module, declare two templates, one for the book page nav, and one for the list of child nodes above it.
Create two files in the module's template directory. I used the book nav template from core, with classes added as @cof6656 suggested. Thanks for that.
Here's a book tree template, for the child node list.
Come to think of it, this might not work for the book nav block, if it's used for that. Not sure. The template only renders one level of links. I'm using Fancytree for the book nav block.
For full control, copy book-tree.html.twig from the book module's template directory (in core/modules/book/templates) and edit that.
Comment #11
grimreaperHello,
Thanks for sharing you code. Here is mine.
No additional CSS or customization of the book-tree. I have changed the h2 into an h4 as the Bootstrap base theme pager. And added an ID to the h4 to have the "aria-labelledby" on nav working.
Comment #12
danchadwick commented@Grimreaper, thanks for sharing your template. @MarkCarver: the book module navigation up to 9 levels deep, something difficult (impossible?) to achieve with views. Perhaps reconsider support for this core module?
Comment #13
markhalliwellSee #5
Comment #14
suryaden commented@Grimreaper, thanks, it works like a charm
Comment #15
ravisagar commented@ Grimreaper
Thanks for the code, it works perfectly.