Announcement

Collapse
No announcement yet.

using thumbnail where available or resized product image

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

    using thumbnail where available or resized product image

    Is somebody able to have a quick look at this for me to see if it's right?
    It seems to work, but I'm a bit wary of making it site-wide without confirmation, IYSWIM

    So far, all my related products in use have thumbnail images because some of the main images for my new stock items (as opposed to my one-off items) are dimensions that won't really resize automatically for thumbnails

    However, I'm keen to have a set-up whereby Actinic uses a thumbnail where available, but uses a resized version of the main product image if there is no thumbnail.

    I've come up with
    Code:
    <img style="border: 0;" src="<actinic:variable name="ProductThumbnailImageFileName" /><actinic:variable name="ProductImageFileName" />" width="75" alt="<actinic:variable encoding="strip" name="ProductName" />" />
    for the lined that usually controls the image/thumbnail

    I'd really appreciate it if somebody is able to confirm that this does what I want it to do? It appears to...but that doesn't necessarily mean it's right LOL
    I'm currently only testing it on one product (with copy layouts etc so as not to interfere with the rest of the site)

    Thanks

    Thanks
    Tracey

    #2
    I would have done it differently and used a blockif testing for null in the thumbnail field. If null then resize main image otherwise (a negated blockif testing for not null) then use the thumbnail image.

    Comment


      #3
      It will be fine Tracey, but it is not foolproof as an image defined in both will produce an error i would expect. I prefer either Duncan's approach, or running a batch process on all existing main images and creating thumbnails i.e. adopt an approach which always has one defined, so it is part of the product setting up process.

      Comment


        #4
        I'm not averse to batch processing them, Lee...but I have so many, in so many different folders..while it may not take me long to resize them, it'll take me ages to actually define them in the product details.

        I'll test it out where I have a thumbnail already set...to see what happens and make sure it doesn't fall down, thanks.

        Ok...the blockif approach...give me a while to attempt that LOL...no doubt I'll be back!
        Tracey

        Comment


          #5
          Originally posted by leehack
          ...running a batch process on all existing main images and creating thumbnails ...
          That's the best way. When creating products one of the first things I do is create the main images and then the thumbnails by batch. Having a thumbnail simplifies things in the long run.

          I also don't personally like to auto-resize on the fly as the image quality is not usually very good.

          Comment


            #6
            ok...of course, Lee was right...where an image thumbnail was entered..it all fell over

            so...the following seems to work...is this right?
            (sorry for the code..I know how ridiculous blockifs look in translation!)

            Code:
            	<actinic:block if="%3cactinic%3avariable%20name%3d%22ProductThumbnailImageFileName%22%20%2f%3e%20%21%3d%20%22%22">
            	<img style="border: 0;" src="<actinic:variable name="ProductThumbnailImageFileName" />" width="75" alt="<actinic:variable encoding="strip" name="ProductName" />" />
            				</actinic:block>
            <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductThumbnailImageFileName%22%20%2f%3e%20%3d%3d%20%22%22">
            					<img style="border: 0;" src="<actinic:variable name="ProductImageFileName" />" width="75" alt="<actinic:variable encoding="strip" name="ProductName" />" />
            				</actinic:block>
            It appears to work on all counts...did I get it right? (eventually LOL)
            Tracey

            Comment


              #7
              Originally posted by drounding
              Having a thumbnail simplifies things in the long run.
              I know, Duncan, and I agree. I do create thumbnails for newly added items but I just don't have time to pick out and alter all the existing products at the minute..hence this approach.

              The quality of the results so far is acceptable...but I do appreciate that resizing like this isn't ideal and it isn't my longterm plan (honest, guv )
              Tracey

              Comment


                #8
                Originally posted by budgetbumps
                ...it'll take me ages to actually define them in the product details...
                Without knowing access you can easily copy the product table into excel, add the thumbnail images filenames into the column,then paste the sheet back into the table again replacing all the contents. (I don't need to mention to you about backing up first)

                Comment


                  #9
                  Your blockif coding looks correct - should work fine. I would also add the width (if you need it) as a custom variable though.

                  Comment


                    #10
                    Run the batch to add '-TN' to the main image name and an excel formula to fill in the thumbnail image name field into an export, should be quite quick in all honesty. Backup or do it on another system and be careful of any fragments going titsup.

                    My approach on any new product is now a 200x200 fixed aspect ratio selction on the raw image and then a resizing for zoom, main and thumb. I then know the size of every single image i use without worrying.

                    This can be a pain to go back through doing, but its important to start somewhere, so all new products should be done like this IMO, before you know it, half the catalog is done and that gives you the push to do the other half.

                    Comment


                      #11
                      ahh..I don't have a width defined mostly because my images, while they are resized as a maximum 200width, 300height size, vary in proportions somewhat (dresses/trousers are long and narrow...tops tend to be squarer) so I didn't want to skew the resized images.

                      Thanks for looking at it though...glad to know I'm learning...albeit slowly!
                      Tracey

                      Comment


                        #12
                        I also adopt the standard image size on all sites now, it takes longer to set it up, but does make resizing for bestsellers, search result images etc a doddle

                        Comment

                        Working...
                        X