I am using drupal core 8.4.2 and lightning 8.x-2.23. I have a entity referenced image field that I am printing out like this {{ content.field_main_image_2.0 }}. I think there was a change starting in drupal 8.4 that now the image label is displayed above the image even if you set it to hidden in the media image bundle. Looking at the source for theme template suggestions it says this.
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'field' -->
<!-- FILE NAME SUGGESTIONS:
* field--media--name--image.html.twig
* field--media--name.html.twig
* field--media--image.html.twig
* field--name.html.twig
* field--string.html.twig
x field.html.twig
-->
<!-- BEGIN OUTPUT from
'themes/contrib/bootstrap/templates/field/field.html.twig' -->
<div class="field field--name-name field--type-string field--label-hidden field--item">name fish</div>
I want to remove the label "name fish" from appearing above the photo. My entity referenced field name is: field_main_image_2 My content type is called: person How should I rename the template named field.html.twig? I tried renaming it to field--field_main_image_2.html.twig and field--field-main-image-2.html.twig, but this didn't work. It says to use this method field--field-foo.html.twig. For now I placed the file field.html.twig in my template folder and it is being used but I dont see where I can remove the label. The template says Available variables: label_hidden: Whether to show the field label or not.