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.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

davidhernandez’s picture

davidhernandez’s picture

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

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

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

@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

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

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

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.