Portal | Homepage | Blog

Change to product image for SEO purposes

I’m trying to add an alt tag to product pictures when they are enlarged but I can not find the code for the enlarged picture page. On a product page when you click on a product image and it enlarges, take a look at your “Alt Tag” or “associated text” as Firefox calls it. All product images have the alt tag = “default-view”.

Alt tag needs to be added and it should look like alt="{product['product_encodedname']}

I can’t seem to find out where this “enlarged picture view” is coming from my credentials for FTP are not working.

Also on line 20 of the product image template the following should be changed to:

<img class="img-thumbnail" src="{additionalview['thumbnail_image']}" alt="{product['product_encodedname']" border="0" />

from

<img class="img-thumbnail" src="{additionalview['thumbnail_image']}" alt="" border="0" />

allowing thumbnails to have “Alt tags”

Here is what I found in the product image template under product page. The {ns:getProductImageScript} is what I believe needs to be edited.

Line 8 Product Image Template:

        <img class="image" alt="{product['product_encodedname']}" title="{product['product_encodedname']}"  src="{product['product_imagesrc']}" id="productphoto" name="productphoto" align="left"/>
          {ns:getProductImageScript}

          {if (product['has_enlarged_images'] || product['has_image_views'])}
            {if (product['has_enlarged_images'])}<i id="has_enlarged_images" class="fa fa-search-plus fa-lg"></i></a>{endIf}

Hi John,

Some time ago we have released a change to our templates that allow to add customizable alt texts to the images but it seems that we would need to extend that to also work with the enlarged images. We will try to work this out with NitroScript first and we’ll get back to you with a solution.

Regards,

Peter