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

Reference: https://www.drupal.org/core/beta-changes
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.
Files: 
CommentFileSizeAuthor
#27 after-classy.png55.83 KBakalata
#27 after-stark.png67.74 KBakalata
#27 before-classy.png58.01 KBakalata
#27 before-stark.png70.46 KBakalata
#27 interdiff-2422679-20-27.txt2.45 KBakalata
#27 classy-text-template-27.patch5.11 KBakalata
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,720 pass(es). View
#21 text-teaser-before.png40.81 KBrteijeiro
#21 text-teaser-after.png40.81 KBrteijeiro
#21 text-before.png52 KBrteijeiro
#21 text-after.png52 KBrteijeiro
#20 classy-text-template-20.diff2.84 KBmortendk
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 88,058 pass(es). View
#18 classy-text-template-18.diff2.84 KBmortendk
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 87,982 pass(es). View
#16 classy-text-template.diff2.84 KBmortendk
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 86,702 pass(es). View
#16 classy-text-interdiff.txt588 bytesmortendk
#11 copy_text_template_to-2422679-11.patch2.07 KBmortendk
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 86,256 pass(es). View
#5 copy_text_template_to-2422679-5.patch2.66 KBdavidhernandez
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 86,247 pass(es). View
#2 copy_text_template_to-2422679-2.patch1.81 KBdavidhernandez
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 86,249 pass(es), 1 fail(s), and 0 exception(s). View

Comments

davidhernandez’s picture

davidhernandez’s picture

FileSize
1.81 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 86,249 pass(es), 1 fail(s), and 0 exception(s). View
davidhernandez’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: copy_text_template_to-2422679-2.patch, failed testing.

davidhernandez’s picture

Status: Needs work » Needs review
FileSize
2.66 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 86,247 pass(es). View

Changing test.

mortendk’s picture

Issue summary: View changes
davidhernandez’s picture

@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

davidhernandez’s picture

Issue summary: View changes
mortendk’s picture

Yeah 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 ;)

davidhernandez’s picture

Silly 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.

mortendk’s picture

Issue summary: View changes
FileSize
2.07 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 86,256 pass(es). View

lets remove the cruft then ;)

davidhernandez’s picture

I don't understand why that is cruft.

mortendk’s picture

its 2 templates that do nothing besides on extending on another template ? isnt that the definiation of cruft

davidhernandez’s picture

And 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.

mortendk’s picture

im suggesting that we clean up as we find stuff in the corners thats just laying there to no use ;)

mortendk’s picture

FileSize
588 bytes
2.84 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 86,702 pass(es). View

@david your right, this issue is about moving templates to classy, if we wanna do cleanup we should do that in followup issues

davidhernandez’s picture

Once 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

mortendk’s picture

FileSize
2.84 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 87,982 pass(es). View
davidhernandez’s picture

Status: Needs review » Needs work

Shouldn't these get moved into Classy's field folder, not the form folder?

mortendk’s picture

Status: Needs work » Needs review
FileSize
2.84 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 88,058 pass(es). View

check misplaced em

rteijeiro’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
52 KB
52 KB
40.81 KB
40.81 KB

It looks good!

Text Node Teaser BEFORE

Text Node Teaser AFTER

Text Node BEFORE

Text Node AFTER

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/text/templates/field--text.html.twig
@@ -4,17 +4,6 @@
- * A 'clearfix' class is added, because 'text' fields have a 'format' property
- * that allows a Text Format to be associated with the entered text, which then
- * applies filtering on output. A common use case is to align images to the left
- * or right, and without this 'clearfix' class, such aligned images may be
- * rendered outside of the 'text' field formatter's boundaries, and hence
- * overlap with other fields. By setting the 'clearfix' class on all 'text'
- * fields, we prevent that.
- *
- * @see https://www.drupal.org/node/2358529
...
-{% set attributes = attributes.addClass('clearfix') %}

Does this not still need to happen in classy's field--text.html.twig?

mortendk’s picture

Status: Needs work » Reviewed & tested by the community

@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

mortendk’s picture

Status: Reviewed & tested by the community » Needs review
akalata’s picture

Since we need to keep clearfix around for compatibility with Bartik and Seven, what happens to this issue?

  1. Close as won't fix?
  2. Postpone on Bartik/Seven updates?
  3. Copy the three files in core/modules/text/templates to classy, and not remove the clearfix in core?
davidhernandez’s picture

Issue tags: +Twig, +Novice

So 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?

akalata’s picture

FileSize
5.11 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,720 pass(es). View
2.45 KB
70.46 KB
58.01 KB
67.74 KB
55.83 KB

I'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.

davidhernandez’s picture

Status: Needs review » Reviewed & tested by the community

I manually tested and see the clearfix and confirmed the correct template is getting used in Bartik.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 27: classy-text-template-27.patch, failed testing.

akalata’s picture

Status: Needs work » Needs review

botfail?

davidhernandez’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 27: classy-text-template-27.patch, failed testing.

davidhernandez’s picture

Status: Needs work » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 6195b19 and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation to the issue summary.

  • alexpott committed 6195b19 on 8.0.x
    Issue #2422679 by mortendk, davidhernandez, akalata: copy text template...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.