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: Manually resize image on product view

  1. #1
    art_r is offline Junior Member
    Join Date
    Jan 2010
    Posts
    20

    Default Manually resize image on product view

    Hi All,
    Currently setting up our first site on ADNSF and we're using image override so that we can use images from our suppliers website. The only issue is that we only get 2 image sizes, 100x100 and 500x500.

    So the 100x100 looks fine in the bigger product listings we do but when going into the actual product it defaults to the medium size which in this case is the 100x100 and looks bad.

    I have had our source modified so that it now puts the 100x100 as small and our 500x500 as medium and large with the idea of manually setting the image size to 250x250 on the product pages but I can not work this bit out.

    My idea is that yes it will load the 500x500 image but that will resize nicely to 250x250 and then if someone clicks on it to view bigger it will already be loaded.

    Currently using a modified product.SimpleVariantFormat.xml.config file and image is called by - <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1, $AltText)" disable-output-escaping="yes"/>

    I tried setting the size of the <TD> to try and force it to resize but that didn't work.

    We do have source access although trying to see if I can do this without altering that as I would need to send that off to the devs to be compiled.

    TIA

    A.
    Last edited by art_r; 03-04-2010 at 02:30 PM. Reason: wrong xml file refernced

  2. #2
    joe.loutzenhiser is offline Junior Member
    Join Date
    Jan 2008
    Location
    Ashland, OR
    Posts
    18

    Default Try a combination of CSS and XSLT

    Something like this:

    <style type="text/css">
    #ProductPic<xsl:value-of select="ProductID" />
    {
    width:150px;
    height:150px;
    }
    </style>

    <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1, $AltText)" disable-output-escaping="yes"/>

    Hope that proves useful.
    Vortx - DevNet partner
    http://www.vortx.com

  3. #3
    art_r is offline Junior Member
    Join Date
    Jan 2010
    Posts
    20

    Default

    Hi Joe,

    CHAMPION!

    That worked perfectly, and was nice and simple to implement.

    Thank you