Jump to content

Automatic image title tagging


Recommended Posts

Well it really depends on where you want to add them, if it's in descriptions, there is nothing you can do but adding them manually. If you are talking about product images, it's possible to edit the template files and add a standard title for all of them, depending on the page you are seeing/element being displayed

Link to comment
Share on other sites

For the single product view, yes, product.tpl.

Basically, in the views_block element, if you look for

<img id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'medium_default')}" alt="{$image.legend|htmlspecialchars}" height="{$mediumSize.height}" width="{$mediumSize.width}" />

You can see it refers to the image legend in the alt property. Since you haven't added any, you can replace it with 

{$product->name}

Or any other tag you like :) 

  • Like 1
Link to comment
Share on other sites

Only to be sure.. I see you are telling me about the alt tag, but I'm looking to add the title tag on images. I have already all images with the alt attribute :)

 

So I think I have add to this: title="{$product->name}" to line: 

 

<img id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'medium_default')}" alt="{$image.legend|htmlspecialchars}" height="{$mediumSize.height}" width="{$mediumSize.width}" />

 
In this way:
 
<img id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'medium_default')}" alt="{$image.legend|htmlspecialchars}" title="{$product->name}height="{$mediumSize.height}" width="{$mediumSize.width}" />
 
Is this good?
 
Thank you.
Link to comment
Share on other sites

×
×
  • Create New...