Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: Product Page Product Image Alt Text Bug/ Issue

  1. #1
    Vegarari is offline Member
    Join Date
    Nov 2006
    Posts
    35

    Default Product Page Product Image Alt Text Bug/ Issue

    Alternate image text issue/bug on product pages, does not work as expected.

    If product has a larger image available then
    Product alt image text ALWAYS = "Click here to view larger image"
    (bad for SEO)

    If medium image and NO large one
    Product alt image text = SEAltText

    And If no SEAltText present
    Product alt image text = Product Name


    The product image alt text Should ALWAYS be the contents of SEAltText if exists
    otherwise Product Name

    We first noticed this in 8.1.0.0

    If anybody, including ASPDNSF Support, knows how to fix this we would be much obliged.

    Casey

    MS 9.3.0.0

  2. #2
    mmcgeachy is offline Senior Member
    Join Date
    Sep 2008
    Posts
    174

    Default

    Which xslt method are you using to show images? At the very least what xmlpackage, if you are using a stock xmlpackage. If it is
    Code:
    <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 0, $AltText)" disable-output-escaping="yes" />
    That alt tag doesn't look to have an issue with large images in the code. There is a title set when there is a large image but the alt text is still there. If you want to change the title text it is just repacling line 2151 in the XSLTExtensionBase.cs with:
    Code:
    tmpS.Append("<img border=\"0\" id=\"ProductPic" + ProductID.ToString() + "\" name=\"" + CommonLogic.IIF(AppLogic.AppConfigBool("NameImagesBySEName") && !String.IsNullOrEmpty(seName), seName, "ProductPic" + ProductID.ToString()) + "\" style=\"cursor:hand;cursor:pointer;\" onClick=\"" + CommonLogic.IIF(ImgGal.HasSomeLarge, "popuplarge" + "_" + sProductID + "()", "popupimg('" + LargePicForPopup + "')") + "\" title=\"" + AltText.Replace("\"", "&quot;") + "\" src=\"" + ProductPicture + "\" alt=\"" + AltText.Replace("\"", "&quot;") + "\" />");

  3. #3
    Vegarari is offline Member
    Join Date
    Nov 2006
    Posts
    35

    Default

    After the reply by mmcgeachy I started digging into this myself, I see that the alt text IS in the HTML. The real issue seems to be that the image title tag contents are displayed in the browser (IE) rather than the alt text (There is no image title attribute unless there is an available larger image). It appears browsers have changed and people's habits have not... So it looks like the real problem here was "How do you display the alt text (instead of the title text which appears if a larger image is available) when hovering over a product image in the browser?".

    mmcgeachy, you are spot-on, you nailed it.

    The code we are using is stock, like your example:
    Code:
    <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 0, $AltText)" disable-output-escaping="yes" />
    found in product page XMLPackages.

    I'm curious, has anyone else felt the need to and/or changed code to display alt text instead of title text or removed title text?

    mmcgeachy, I thank you for your solution, time and effort with this!

    Casey

    MS 9.3.0.0