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/forum/templates/forum-icon.html.twig
core/modules/forum/templates/forum-list.html.twig
core/modules/forum/templates/forum-submitted.html.twig
core/modules/forum/templates/forums.html.twig
Comment | File | Size | Author |
---|---|---|---|
#37 | copy_forum_templates_to-2349683-36.patch | 4.64 KB | davidhernandez |
#36 | interdiff-30to36.txt | 630 bytes | davidhernandez |
#36 | copy_forum_templates_to-2349683-36.txt | 4.64 KB | davidhernandez |
#30 | interdiff-29to30.txt | 672 bytes | davidhernandez |
#30 | copy_forum_templates_to-2349683-30.patch | 4.64 KB | davidhernandez |
Comments
Comment #1
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
davidhernandezThe templates should go into the root of the templates folder, not a subfolder.
Morten you agreed to put them in one folder. I'm not sure why these patches are now all going in subfolders.
Comment #4
mortendk CreditAttribution: mortendk commentedcause i was stupid ;)
this patch have issues with test its using xpath so killing the ID's & classes gives us issues
Comment #6
mortendk CreditAttribution: mortendk commentedComment #7
mortendk CreditAttribution: mortendk commentedComment #8
danquah CreditAttribution: danquah commentedComment #9
danquah CreditAttribution: danquah commentedComment #10
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 #13
emma.mariaReviewing this now.
Comment #14
emma.mariaModule templates
The following look fine to me, they have the classes and IDs stripped out.
core/modules/forum/templates/forum-list.html.twig
core/modules/forum/templates/forum-submitted.html.twig
core/modules/forums.html.twig
Here is what Stark looks like before and after the patch.
My issues with this patch are....
Should we leave a completely empty "a" link wrapper here? Doesn't the ID provide a function as an anchor link for new? I would put this back in the module file.
We need to keep visually-hidden classes they provide a function for accessibility.
again visually-hidden needs to be put back in the module file.
Otherwise the patch does not break any other functioning of the forum module.
Also the original files from the module have been added to the Classy theme and contain no changes.
Comment #15
emma.mariaTagging novice for the improvement work said in #14 on the patch in #4.
The work in #14 are small tasks of putting things back into template files that were removed by the patch.
Comment #16
mortendk CreditAttribution: mortendk commented1. hmm do we consider this functionality ? - i can see that it could be ?
2. the visually-hidden is still a a class - its not prefixed as beein essential or with a specific "drupal-stuff" ala js- etc.
Ib core Were assuming absolutely nothing on the frontend. we Dont wanna break the chance for a theme to do completely new things in the future. So yes visually hidden or whatever else unless its absoluterly nessersary for functionality should be removed - its up to a themer to add that it in.
Comment #17
davidhernandezThe visually-hidden stuff is part of a group of classes used for hiding content and accessibility. We should keep those in the core template. It might make sense to have those renamed or handled in a different way, but that's not something we should try to solve here. That should be a global Drupal core issue.
Comment #18
mortendk CreditAttribution: mortendk commented@david true - lets keep them here then take that on as a general issue later on, so we can attacch that to the behaviour of classy
Comment #19
mortendk CreditAttribution: mortendk commentedadded back the new id & visually-hidden classes
Comment #20
DickJohnson CreditAttribution: DickJohnson commentedEverything else seems to be okay, but:
1. In classy/templates/forum-submitted.html.twig we say:
But I can't see the submitted class in DOM. With Classy installed and enabled:
With Stark installed and enabled:
2. In every file-comment we have line like
Do we need these in Classy?
Comment #21
DickJohnson CreditAttribution: DickJohnson commentedI can't see the class without the patch either, so it seems that either I'm doing something wrong or then we have a place for follow up issue. From my point of view this is RTBC.
Comment #22
mortendk CreditAttribution: mortendk commentedthis should be followup issue, also i dont really understand the issue ;) but please create it
Comment #23
Manuel Garcia CreditAttribution: Manuel Garcia commentedThe patch still applies cleanly, no need to reroll.
Code looks good. I went ahead and did some manual testing:
@DickJohnson that template file is used only on forum listings, not on the final forum node page. So this means it shows up under /forum, /forum/1 and so on. The class appears there fine, so no problems there.
This good to go imho.
Comment #24
davidhernandezattributes should stay. Only remove the addClass part.
Comment #25
Manuel Garcia CreditAttribution: Manuel Garcia commentedGood catch @davidhernandez , here is the updated patch (based on #19).
Comment #27
Manuel Garcia CreditAttribution: Manuel Garcia commentedOops... forgot to add the new files...
Comment #28
davidhernandez@Manuel, check your Git settings to make sure it is optimized for copying. See the handbook instructions here - https://www.drupal.org/documentation/git/configure
If optimized, Git will make the file copy one line, like Morten's patch in #19, where it looks like the following:
This makes it easy to review and commit, because we can see the file is copied and not edited.
If it isn't working, try git diff -C.
Comment #29
mortendk CreditAttribution: mortendk commentedrerolled the patch added back in the attributes that was missed before, good catch :)
Comment #30
davidhernandezThis else is not needed since the class was removed. Uploading a fix.
Otherwise, everything looks fine. All the forum modules CSS is visual, and there is no JS.
Comment #32
mortendk CreditAttribution: mortendk commentedhuh is testbot drunk ? heres some coffe go test
Comment #34
Manuel Garcia CreditAttribution: Manuel Garcia commented@davidhernandez thanks for useful link & info, done -=]
I've read through the patch, it looks (even more) beautiful. RTBC'ing
Comment #35
mortendk CreditAttribution: mortendk commented@manuel im using sourcetree it makes it all work for me
Comment #36
davidhernandezFixing the space around the 'if'. Previously it would put a blank space when there was no colspan.
Comment #37
davidhernandezOops. Named that .txt for some reason. Same interdiff applies.
Comment #38
mortendk CreditAttribution: mortendk commentedPatch works and white space cleaned up
css
took a look at the css as well, the css file should be renamed from forum.module to forum.theme.css as theres no essential css for the forum to work.
im adding this as a followup issue, to get the MAT css fixed / at least have note on it.
#2421099: forum module css file follow MAT naming
Comment #39
alexpottTheme changes are not blocked by beta. Committed e6e3034 and pushed to 8.0.x. Thanks!