Book navigation blocks currently output all items using unordered lists. As the entire point of the Book module is to add structure (a meaningful order) to a collection of nodes, the navigation blocks displaying that structure should display it with the proper intent (i.e., an ordered list).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

michael.otolorin’s picture

Assigned: Unassigned » michael.otolorin
michael.otolorin’s picture

michael.otolorin’s picture

Status: Active » Needs review

Status: Needs review » Needs work
michael.otolorin’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
xjm’s picture

Looks like the hash sign in the patch name breaks it. I can't open the file.

halefx’s picture

Status: Needs work » Needs review
FileSize
2.75 KB

Readding michaelotolorin's patch

Status: Needs review » Needs work
halefx’s picture

Status: Needs work » Needs review
FileSize
1.92 KB

Previous one had html thrown in

Status: Needs review » Needs work
heartin’s picture

I am a bit new to drupal, but I did a small workaround and my drupal book index is now showing as an ordered list.

I added below line into book-navigation.tpl.php before printing $tree:
<?php $tree = str_replace('ul', 'ol', $tree);?>

You can see the output at http://www.javajee.com/core-java-articles.

Let me know if there is a better solution which works.

xjm’s picture

Version: 7.14 » 8.x-dev
kbasarab’s picture

Here is first roll for 8.x.

Not sure why the patches above were removing the hook_block_info() and other items at beginning.

I also address in this patch changing the output for when config displays the block only when the user is browsing this book.

There might still be some changes to be made in terms of the if statement within the foreach (book_get_books()... loop. All of the logic inside:

 295       if ($book['bid'] == $current_bid) {
 296         // If the current page is a node associated with a book, the menu
 297         // needs to be retrieved.
 298         $book_menus[$book_id] = menu_tree_output(menu_tree_all_data($node->book['menu_name'], $node->book));
 299       }
 300       else {
 301         // Since we know we will only display a link to the top node, there
 302         // is no reason to run an additional menu tree query for each book.
 303         $book['in_active_trail'] = FALSE;
 304         // Check whether user can access the book link.
 305         $book_node = node_load($book['nid']);
 306         $book['access'] = node_access('view', $book_node);
 307         $pseudo_tree[0]['link'] = $book;
 308         $book_menus[$book_id] = menu_tree_output($pseudo_tree);
 309       }

Is basically negated right now. That needs to be address but this gets the patch started on 8.

kbasarab’s picture

Status: Needs work » Needs review
star-szr’s picture

Assigned: michael.otolorin » Unassigned
Category: bug » feature

Changing to feature request, can't this be overridden in the theme layer?

Status: Needs review » Needs work

The last submitted patch, 14: book_navigation_ol-1665782-14.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

PCate’s picture

Issue summary: View changes

I think the approach to implementing this has radically changes starting with Drupal 8 and the inclusion of Twig. You can directly edit the book-tree.html.twig Twig template to change the list type. I believe making this the default should just mean updating all the core version of this template. Not sure if this is considered a breaking change that would need to wait until Drupal 10 however.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs work » Postponed

This extension is being deprecated, see #3376070: [Meta] Tasks to deprecate Book module. It will be removed from core and moved to a contrib project, #3376101: [11.x] [Meta] Tasks to remove Book.

This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

This issue may be re-opened if it can be considered critical, If unsure, re-open the issue and ask in a comment.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.