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 7 of 7

Thread: Skin-specific Product Images

  1. #1
    linhoff is offline Junior Member
    Join Date
    Jul 2009
    Posts
    27

    Default Skin-specific Product Images

    I have a project where I need to have a 4th product image size ("Small" - not 'icon','medium',or 'large') called from a special skin.
    For category images, I was able to easily create a "images/category/small/" directory within the skin's directory structure and change the .xml package to call for 'small' instead of 'icon'. This worked just fine to display the special sized images for the categories
    Working Example:
    <xsl:value-of select="aspdnsf:LookupEntityImage(EntityID, $EntityName, 'small', 0, $AltText)" disable-output-escaping="yes" />

    Trying the same method only results the product image defaulting to 'medium'.
    Non-Working Example:
    <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFileNameOverride, SKU, 'small', 1, $AltText)" disable-output-escaping="yes"/>

    Is there a way to either a) direct an xml package to pull product images from a directory within the skin directory
    OR
    Is there a way to create a 4th image folder within the root directory and have the program recognize it.

    (I am using SKU's to identify product images, not product ID's.)

    I would appreciate any suggestions! Thank you,

  2. #2
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    All versions of the software we've released within the last few years already support a 4th size of image, which we call Micro. You can set the size for those images with an AppConfig, and the software can auto-create those when you upload other images just like it does with medium and icon. Why not just use that built in functionality?

    http://manual.aspdotnetstorefront.co...iguration.aspx

  3. #3
    linhoff is offline Junior Member
    Join Date
    Jul 2009
    Posts
    27

    Default

    You are right, I should have said "5th image". It seems simple enough to replace the 'icon' call to a 'micro' call, but there is obviously more happening in the background of which I am unaware.

    I tried using the Micro images (used for multi-image thumbnails on product pages), which produced the same results as using my 'small' image attempt.

    With "icon" used in the code string, the category pages shows it's products with an Icon image which links to the product page.

    With "micro" (or 'small') used, the category page shows the product images as they appear on the products page: a Medium image with multiple Micro images below it and the link opens not only the product page but the 'Large' image pop-up.

    All I am changing is the red text in this line of code:

    <tr><td height="30" align="center" valign="bottom">
    <a>
    <xsl:attribute name="href">
    <xsl:value-of select="aspdnsf:ProductandEntityLink(ProductID, SEName, $EntityID, $EntityName, 0)" disable-output-escaping="yes"/>
    </xsl:attribute>
    <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFileNameOverride, SKU, 'icon', 0, $AltText)" disable-output-escaping="yes"/>
    </a>
    </td></tr>

    to the red text in this:
    <tr><td height="30" align="center" valign="bottom">
    <a>
    <xsl:attribute name="href">
    <xsl:value-of select="aspdnsf:ProductandEntityLink(ProductID, SEName, $EntityID, $EntityName, 0)" disable-output-escaping="yes"/>
    </xsl:attribute>
    <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFileNameOverride, SKU, 'micro', 0, $AltText)" disable-output-escaping="yes"/>
    </a>
    </td></tr>

    So, I tried that with the same results. I have attached screen shots of the results of using both 'micro' (first image) and 'icon' (2nd image) calls, showing the different results.
    The 'icon' results are fine, just the picture is the wrong size.

    I appreciate your thoughts on this!
    Attached Images Attached Images   

  4. #4
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    You could always use aspdnsf:StrReplace() and search for the width and height attributes (since these are known and always the same) and replace them with the new sizes you want.
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!

  5. #5
    linhoff is offline Junior Member
    Join Date
    Jul 2009
    Posts
    27

    Default aspdnsf:StrReplace()

    Thank you for the suggestion. I will gladly look into this, but I am afraid I need to ask you to expand a little on your instruction to 'use aspdnsf:StrReplace() and search....". I am unsure as to the file in which I am searching.
    Also, just to be clear, the current sizes of Micro, Icon, Medium, and Large are just fine. I do not want to alter existing sizes, since the Micro size fits my needs. The dilemma is that the xml package does not display a 'Micro' image as expected, but defaults to a Medium image as noted in my previous thread note.
    If I could have the "aspdnsf:LookupProductImage" parameters accept and display 'micro' like it accepts and displays 'icon', that should resolve the problem.
    Thank you again for spending time in assisting with this challenge!

  6. #6
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    Try something like this:

    Code:
    <xsl:value-of select="aspdnsf:StrReplace(aspdnsf:LookupProductImage(ProductID, ImageFileNameOverride, SKU, 'icon', 0, $AltText),'/icon/','/micro/')" disable-output-escaping="yes"/>
    That allows ASPDNSF to return the icon image name and replaces the icon folder name with the micro folder name. So:

    Code:
    images/Product/icon/xyz.jpg
    becomes:
    Code:
    images/Product/micro/xyz.jpg
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!

  7. #7
    linhoff is offline Junior Member
    Join Date
    Jul 2009
    Posts
    27

    Default Thank you! Perfect solution!

    That worked just right, and also allows me to create and use new image size options. Thank you very much for the education!
    Cheers!