cancel
Showing results for 
Search instead for 
Did you mean: 

Adding "alt" tags for the product images in magento2

Adding "alt" tags for the product images in magento2

Hi All,

We are having lot of w3 validation errors in my website and all are related to the images alt tags as below:

Error: An img element must have an alt attribute, except under certain conditions. 

Is there any way to add alt tags for the images to solve these w3 validation errors.
We are using Magento Version: 2.1.2

Anyone have a solution for this..Please suggest me..

Thanks,
siva.

9 REPLIES 9

Re: Adding "alt" tags for the product images in magento2

Hi @soho_rize,

 

Are you talking about the alt text?

 

Área de trabajo 1_005.png

 

 

Re: Adding "alt" tags for the product images in magento2

Hi Damian,

Yes..you are right..I am asking the same..
We have tried to add the alt text but it was not getting for my images.

Can you suggest any thing we need to do in product configuration(creating/editing) to get "Alt" attributes for product images.

Thanks,
Siva.

Re: Adding "alt" tags for the product images in magento2

@soho_rize,

 

I've made a new test and the alt text works right.

 

Edition:

 

Área de trabajo 1_001.png

 

Category View:

 

Área de trabajo 1_002.png

 

Product View:

 

Área de trabajo 1_003.png

 

 

Is this what you are looking for?

 

 

Re: Adding "alt" tags for the product images in magento2

I am looking for this kind of thing in magento 1.9

 

Please suggest me, how can i do that, 

so that i can fetch the same alt text for the respective product image.

 

 

Re: Adding "alt" tags for the product images in magento2

In my instance of Magento (2.1.3), adding the alt text the way you described creates a caption and not alt text.

 

This is what it's adding to the code:

"caption":"Organic Bergamot Essential Oil, 5 ml"

Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fail

Hello 

I have used magento 2 version , I have on issue when we run importer file its showing me FOREIGN KEY error 

 

https://www.screencast.com/t/SBRzRHNicWsY

 

Importer file getting data from xml file and adding or update product image and other information 

 

Please let me know  how can i fix this

Re: Adding "alt" tags for the product images in magento2

Can you please help us how you added that alt text to

Re: Adding "alt" tags for the product images in magento2

Is there an option to do this in the previous version of Magento?

Re: Adding "alt" tags for the product images in magento2

You can import it - 

base_imagebase_image_labelsmall_imagesmall_image_labelthumbnail_imagethumbnail_image_label