show entire Book Navigation tree My question is about how to show the entire book navigation tree in a block (drupal 8)

Thanks to @oknate we can have a Book Navigation block with the top level book showing, But i need the whole tree. (think table of contents)

All the folowing examples assume you are are the top page of a 3 level deep book.

Also, I have a working module at https://github.com/petergus/alt-book-nav.git

Showing the title (top level) book in the book navigation block is done by replacing the following in book/src/Plugin/Block/BookNavigationBlock.php (with a custom module of course)

 // Only show the block if the user has view access for the top-level node.
  if ($nid) {
    $tree = $this-&gt;bookManager-&gt;bookTreeAllData($node-&gt;book['bid'], $node-&gt;book);
    // There should only be one element at the top level.
    $data = array_shift($tree);
    $below = $this-&gt;bookManager-&gt;bookTreeOutput($data['below']);
    if (!empty($below)) {
      return $below;
    }
  }


with

     if ($nid) {
        $tree = $this-&gt;bookManager-&gt;bookTreeAllData($node-&gt;book['bid'], $node-&gt;book);
        return $this-&gt;bookManager-&gt;bookTreeOutput($tree);
      }


That only shows the top level and child level though, I want to be able to view the full tree from any page.

I am completely new with drupal 8 and not very handy with PHP so all i could find out was that 

     $tree = $this-&gt;bookManager-&gt;bookTreeAllData($node-&gt;book['bid'], $node-&gt;book);
     kint($tree);


returns only the book name and first level
and 

     $tree = $this-&gt;bookManager-&gt;bookTreeAllData($node-&gt;book['bid']);
     kint($tree);


(without the $node-&gt;book) returns multiples levels, that is, multiple 'below' arrays.



I have no idea how to go further with pulling that information into the block, does someone?

As mentioned above, I have the module that @oknate suggested at https://github.com/petergus/alt-book-nav.git

Greatly appreciating any help, and hoping this questions serves the community.
It turns that I already posted the answer in the question, but somehow missed it during testing!

Removing , $node-&gt;book from $tree = $this-&gt;bookManager-&gt;bookTreeAllData($node-&gt;book['bid'], $node-&gt;book); does print the entire expanded tree.

If someone has time to add a user form option to the module it could eventually benefit many and get on the drupal.org repo.