Announcement

Collapse
No announcement yet.

Query on preview for KB/AUG script for automatically resizing thumbnails

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Query on preview for KB/AUG script for automatically resizing thumbnails

    Just checking I'm not missing something obvious and in case anyone else has the same problem. Still on V9.

    I was intending to use the guide in the Knowledge Base http://community.sellerdeck.com/showthread.php?t=45409 "Can I automatically resize my product images?" (also in the V9 AUG) to create thumbnails to use in my Best Sellers and New Products lists to cut down on the size of images on my homepage. Both say at the end:

    You can now use the following line to include the rescaled product images in the best seller / new products / related items / also bought lists:

    <img src="Thumbnails/t_<actinic:variable name="ProductImageFileName" />" />


    When I do this, though, on preview my site is looking for image names like this:

    <img src="Thumbnails/t_images\scott_nylon_cage_red.jpg">

    Because my original images are in an 'images' sub-folder of Site1. I suspect it would work on the live site, but it is not ideal having the preview not working.

    I read here http://community.sellerdeck.com/arch...p/t-34654.html that the restriction that product images had to be in the Site folder had been lifted, but is this not the case?

    I managed to get it to work OK in preview by putting this into the Best Sellers layout instead:

    <actinic:block php="true" >
    $sOriginalImageName = basename(str_replace('\\','/', '<actinic:variable name="ProductImageFileName" encoding="perl" selectable="false" />'));
    echo "<img src=\"Thumbnails/t_$sOriginalImageName\"
    width=\"75\" border=\"0\"";
    </actinic:block>


    Though I have since also found Norman's alternative in post #6 of this thread http://community.sellerdeck.com/showthread.php?t=40605 which seems a better solution to my needs as it only creates the thumbnails for products in the Best Seller or New Products lists, which is all I need, and as it uses basename to create the thumbnail name which goes into the img src tag I think this will work fine in preview.

    I think I've figured this out for myself while waiting for my forum account to be activated, but grateful if anyone can confirm that this is an issue with the KB instructions or point out what silly mistake I was making!
Working...
X