How to add a title attribute to the image field by default?

Created on 1 February 2025, 3 months ago

Hello,
I have created a view that shows images from content, they come from an Image field.
They all have an alt and title attribute, which both contain the title of the content which the image belongs to.
When I show the images in a view and I inspect the page with the browser's inspect feature I see that the alt is used for these images but the title is not.
Therefor there is no balloon tip with the title when I hover over the image because that comes from title and not from alt. Which I do have for other pages where I have created my own template to show this content with alt and title. But for this view it uses the default image field processing.
I see this in the template for bootstrap5 in image.html.twig:
{%
set classes = [
style_name ? 'image-style-' ~ style_name|clean_class,
]
%}

This leads me to think their is a class with iamge attributes that maybe doesn't have the title there?

But maybe I am looking at solving this issue down the wrong path and it might not having anything to so with the theme or css, but if it is and someone could point me in the right direction that would be great,
Greetings.
Rob

💬 Support request
Status

Active

Version

6.0

Component

User interface

Created by

🇳🇱Netherlands RobBNL

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

Comments & Activities

Production build 0.71.5 2024