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.
Problem/Motivation
text templates should be in classy and group with all other form templates.
the template in core should be cleaned of all non essential classes
Proposed resolution
copy:
field--text.html.twig
to classy
- remove .clearfix from field--text.html.twig
Remaining tasks
User interface changes
API changes
Beta phase evaluation
Issue category | Task |
---|---|
Issue priority | Normal |
Unfrozen changes | Unfrozen because it only changes templates |
Prioritized changes | The main goal of this issue is to improve themer experience. |
Disruption | Should not be disruptive. |
Comment | File | Size | Author |
---|---|---|---|
#27 | after-classy.png | 55.83 KB | akalata |
#27 | after-stark.png | 67.74 KB | akalata |
#27 | before-classy.png | 58.01 KB | akalata |
#27 | before-stark.png | 70.46 KB | akalata |
#27 | interdiff-2422679-20-27.txt | 2.45 KB | akalata |
Comments
Comment #1
davidhernandezComment #2
davidhernandezComment #3
davidhernandezComment #5
davidhernandezChanging test.
Comment #6
mortendk CreditAttribution: mortendk commentedComment #7
davidhernandez@morten. I moved all three. Do you not want all three in the module? Though I admit these have got to be the three smallest templates in the world. :P
Comment #8
davidhernandezComment #9
mortendk CreditAttribution: mortendk commentedYeah it kinda seems silly to have em, why did we have em in the first place, that enherits from eachother ?
I mean a themer can do that without us handholding ;)
Comment #10
davidhernandezSilly to have em? From that guy that wants all the templates?? :)
From the original issue it was something about having to create theme implementations for all of them but they wouldn't contain more than their actual content. They just existed to exist.
Comment #11
mortendk CreditAttribution: mortendk commentedlets remove the cruft then ;)
Comment #12
davidhernandezI don't understand why that is cruft.
Comment #13
mortendk CreditAttribution: mortendk commentedits 2 templates that do nothing besides on extending on another template ? isnt that the definiation of cruft
Comment #14
davidhernandezAnd the main template does nothing except extend field. I'm just surprised that you're now suggesting not to copy everything. I don't understand the rationale.
Comment #15
mortendk CreditAttribution: mortendk commentedim suggesting that we clean up as we find stuff in the corners thats just laying there to no use ;)
Comment #16
mortendk CreditAttribution: mortendk commented@david your right, this issue is about moving templates to classy, if we wanna do cleanup we should do that in followup issues
Comment #17
davidhernandezOnce the Classy folder re-organization gets in, this will need a reroll. These three templates are fields, so copy them to the 'fields' folder in Classy.
#2349559: [meta] Discuss the organization of subfolders in Classy
Comment #18
mortendk CreditAttribution: mortendk commentedrerolled after #2349559: [meta] Discuss the organization of subfolders in Classy
Comment #19
davidhernandezShouldn't these get moved into Classy's field folder, not the form folder?
Comment #20
mortendk CreditAttribution: mortendk commentedcheck misplaced em
Comment #21
rteijeiro CreditAttribution: rteijeiro commentedIt looks good!
Text Node Teaser BEFORE
Text Node Teaser AFTER
Text Node BEFORE
Text Node AFTER
Comment #22
alexpottDoes this not still need to happen in classy's field--text.html.twig?
Comment #23
mortendk CreditAttribution: mortendk commented@alex yes we still add classes ( even good old clearfix) as they originally are so we dont mess with thatever bartik + seven are doing.
Were making sure that core is clean, i would love to remove all clearfixes, but we should not do that for bartik + seven before that css work starts
Comment #24
mortendk CreditAttribution: mortendk commentedComment #25
akalata CreditAttribution: akalata commentedSince we need to keep clearfix around for compatibility with Bartik and Seven, what happens to this issue?
Comment #26
davidhernandezSo these template were specifically added for the clearfix, for Bartik, and for people to override. Moving them to Classy is fine, and the clearfix will be in Classy. Removing the clearfix from core means we end up with three empty templates. If no one objects to that, then fine. We should probably add a comment to the templates though stating why they are there.
Now that I think about it, can't we just delete these templates? Moving them to Classy means they are part of a theme, so the registry will pick them up as overrides. We wouldn't need the text_theme() function. Anyone want to test that?
Comment #27
akalata CreditAttribution: akalata commentedI've just recently realized that both Bartik and Seven are extensions of Classy. So introducing the templates in Classy, rather than core, should be okay.
Attaching a patch along with before-and-afters in Stark and Classy.
Comment #28
davidhernandezI manually tested and see the clearfix and confirmed the correct template is getting used in Bartik.
Comment #30
akalata CreditAttribution: akalata commentedbotfail?
Comment #32
davidhernandezComment #35
davidhernandezComment #36
alexpottCommitted 6195b19 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.