Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
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).
Comments
Comment #1
michael.otolorin CreditAttribution: michael.otolorin commentedComment #2
michael.otolorin CreditAttribution: michael.otolorin commentedComment #3
michael.otolorin CreditAttribution: michael.otolorin commentedComment #5
michael.otolorin CreditAttribution: michael.otolorin commented#2: drupal_core-book_navigation_blocks_should_use_ordered_lists-1665782-#4.patch queued for re-testing.
Comment #7
xjmLooks like the hash sign in the patch name breaks it. I can't open the file.
Comment #8
halefxReadding michaelotolorin's patch
Comment #10
halefxPrevious one had html thrown in
Comment #12
heartin CreditAttribution: heartin commentedI 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.
Comment #13
xjmComment #14
kbasarab CreditAttribution: kbasarab commentedHere 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:
Is basically negated right now. That needs to be address but this gets the patch started on 8.
Comment #15
kbasarab CreditAttribution: kbasarab commentedComment #16
star-szrChanging to feature request, can't this be overridden in the theme layer?
Comment #27
PCate CreditAttribution: PCate as a volunteer commentedI 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.Comment #32
quietone CreditAttribution: quietone at PreviousNext commentedThis 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.