Right now, I believe the template is forked from classy which has some horrible handling around markup being different for mutli and single delta fields.

I propose the markup remains the same regardless of the field cardinality, the template is highly simplified and the tests are expanded to assert the change.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sam152 created an issue. See original summary.

Sam152’s picture

Status: Active » Needs review
FileSize
4.62 KB

Attached is a more predictable field template with an updated test to test all field classes and configurable tags work.

Sam152’s picture

As shown in the test, the markup shown might look something like:

      <article class="my-field-class clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above field__items">
        <h2 class="my-label-class field__label">Body</h2>
        <code class="my-field-item-class field__item">
          <p>Body field value.</p>
        </code >
      </article>
Sam152’s picture

Status: Needs review » Fixed

  • Sam152 committed 17e56ed on 8.x-2.x
    Issue #2576635 by Sam152: Decide on a field template with sane handling...

Status: Fixed » Closed (fixed)

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