Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
(First, verify that the preprocess changes have been made. #2322163: [meta] Consensus Banana Phase 1, move CSS classes from preprocess to twig templates.)
- Copy the Twig templates from the core module's templates directory to Classy's templates directory. Include all templates, even ones without classes.
- Remove all classes from the core module's template. Remove all classes added with addClass and ones that are hard-coded in the template.
- If there are classes that are required for basic functionality, discuss whether they should be kept.
- If there is CSS from the module, or anywhere else, referring to the class, discuss removing it or moving it to Bartik&Seven. Do not move the CSS to Classy.
Twig Templates to Copy
core/modules/book/templates/book-all-books-block.html.twig
core/modules/book/templates/book-export-html.html.twig
core/modules/book/templates/book-navigation.html.twig
core/modules/book/templates/book-node-export-html.html.twig
core/modules/book/templates/book-tree.html.twig
Comment | File | Size | Author |
---|---|---|---|
#18 | Screenshot-book-js-2014-11-12.png | 61.01 KB | bradwade |
#16 | copy_book_templates_to-2349633-16.patch | 9.89 KB | runand |
#8 | copy_book_templates_to-2349633-8.patch | 5.16 KB | mortendk |
#4 | book-to-classy-2349633-4.patch | 9.93 KB | emma.maria |
#2 | classy-book.diff | 4.69 KB | mortendk |
Comments
Comment #1
davidhernandezComment #2
mortendk CreditAttribution: mortendk commentedmoved the classes out of core
Discussion of the classes - should be done as a follow up, so bikesheedding wont stop classy ;)
Comment #3
emma.mariaComment #4
emma.mariaThe module template folder was added directly to Classy root folder, added them to classy/templates/book/*
Comment #7
davidhernandezThe templates should go into the root of the templates folder, not a subfolder.
Comment #8
mortendk CreditAttribution: mortendk commentedremoving the
id="book-navigation-{{ book_id }}"
in book-navigation.html.twig gave me a bunch of test errorscant find where n why but this should pass the test + move to /templates the discussion of where to put stuff is in #2349559: [meta] Discuss the organization of subfolders in Classy
Comment #9
mortendk CreditAttribution: mortendk commentedand testbot lets see what you got
Comment #10
mortendk CreditAttribution: mortendk commentedComment #11
runand CreditAttribution: runand commentedComment #12
runand CreditAttribution: runand commentedAs mentioned, the id in book navigation is not removed, but everything else looks ok
Comment #13
lauriiiThe templates are not generated to classy. Dont know whats wrong
Comment #14
lauriiiOk, works while using git apply! Yeah!
Comment #15
alexpottWhy are making these changes to the classy template? The classy template should have these classes no?
Comment #16
runand CreditAttribution: runand commentedComment #17
davidhernandezPlease double-check if any removed classes are being used in javascript. It is best to test the affected template using Stark to make sure nothing is broken.
Comment #18
bradwade CreditAttribution: bradwade commentedWhile book.js does reference classes, specifically .book-outline-form and .book-title-select, neither of these were removed in these template changes. (Those classes are added in by BookManager.php)
I tested and the book.js continues to function properly with patch #16 applied. To test this you must enable Stark as your admin theme and add/edit a book page (book module must be enabled). The JS updates the summary under the heading of the "book outline" vertical tab when a new book/parent is selected. Note: This JS is not being executed in the Seven theme as Seven has removed this functionality of displaying a summary along with the vertical tab heading.
To summarize: Double checked. Javascript not broken.
Comment #19
mortendk CreditAttribution: mortendk commented@bradwave Ok then we should set it back to RTBC :)
Comment #20
bradwade CreditAttribution: bradwade commentedComment #21
alexpottThis issue is a prioritized change (theme improvements) as per https://www.drupal.org/core/beta-changes and it's benefits outweigh any disruption. Committed 8de9b67 and pushed to 8.0.x. Thanks!
Comment #23
mortendk CreditAttribution: mortendk commented*high fives all around*