Inline labels are put above

Created on 12 August 2019, about 6 years ago
Updated 17 July 2025, about 1 month ago

Basic doens't handle labels correctly. Inline labels are put above.

It looks like the field.html.twig needs som work still: 

1. This comment refers to something that can be uncommented, but there is nothing to uncomment:

{# BEM inspired class syntax: https://en.bem.info/
   Enable this code if you would like field classes like "article__tags", where article is the content type and field_tags is the field name.
#}
{% set classes = classes|merge([
  bundle ~ '__' ~ field_name|replace({'field_' : ''})|clean_class
]) %}

2. The following comment referes to an issue that now has been resolved:

{#
  Ensures that the visually hidden option for field labels works correctly.
  @todo: Remove when https://www.drupal.org/node/2779919 is resolved.
#}
{% set title_attributes = title_attributes.addClass(label_display == 'visually_hidden' ? 'visually-hidden') %}

3. I added this code to get the classes needed to differentiate between inline labels and above labels, inserted at line 5:

{%
  set classes = [
    'field',
    'field-type-' ~ field_type|clean_class,
    'field-label-' ~ label_display,
  ]
%}

But I assume there is a better ways to do it. 

Thanks

πŸ“Œ Task
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΈπŸ‡ͺSweden hstrindb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024