My content type contains an Entity Reference Revision field. The node display has CSS classes for all fields, except for Entity Reference Revision ones. For example, I have a text field and it's wrapped in a div with classes of "field-field-name field-type-string". But my Entity Reference Revision field is not wrapped in any div at all, and instead shows the label and paragraph element without a wrapper;

<details id="info" class="js-form-wrapper form-wrapper horizontal-tabs-pane" open="open">
  <summary role="button" aria-controls="info" aria-expanded="true" aria-pressed="true">Contract Info</summary>
  
<div class="field-field-contract-number field-type-string">
  
    <div class="field-item-label">Contract Number</div>
        <div class="field-item">1234</div>
    </div>

<!--why is there no field-field-name div here??-->
  <div class="field--label">Contract Contact</div>
  <div>
      <div class="paragraph paragraph--type--contract-contact paragraph--view-mode--default paragraph--id--417">
          <div class="paragraph__column">
          </div>
      </div>
  </div>
<!-- and why no closing /div for field-field-name here?? -->
  
  
</details>

This happens to me with Bartik. I am not using an core experimental layouts nor Display Suite. I *am* using Field Group, but this issue happens whether or not the ERR field is inside a field group.

Is this behavior intentional? Has anyone else encountered this? It seems to me fields should get wrapped in a div with standard classes, even if they are ERR fields.

Comments

caspervoogt created an issue. See original summary.

markdc’s picture

I'm also experiencing this with Paragraphs. It's preventing me from taking advantage of CSS combinators. I would like to simply remove the wrapper altogether so that Paragraphs can be on the same DOM level.

Edit: I'm using Bootstrap, though it shouldn't matter.

berdir’s picture

Status: Active » Postponed (maintainer needs more info)

This module doesn't provide any templates, it should use the same defaults as any other field type. Enable twig debug, check which template is used and why it doesn't show a wraper.