Jquery Thumbnails

Permalink
Hi

I am trying to create a larger thumbnail in a cut down custom version of the image slider for another block.

I can get the standard size 'file_manager' thumbnail image to show, but I cannot see how I can get my custom thumbnail size to work (100x100).

The code calling the file information is here
$(r.files).each(function() {
                            li.replaceWith(
                                _templateSlide({
                                    fID: this.fID,
                                    thumbnail: this.resultsThumbnailImg
                                })
                            );
                        });


It doesnt matter what I do, all that happens is the standard thumbnail shows or nothing.

I have found the source where the 'resultsThumbnailImg' is being called from and have tried to change the following code to my thumbnail handle, but to no avail. It is in a file here /concrete/src/File/Version.php
public function getDetailThumbnailImage()
    {
        if ($this->fvHasDetailThumbnail) {
            $type = Type::getByHandle(\Config::get('concrete.icons.file_manager_detail.handle'));
            $baseSrc = $this->getThumbnailURL($type->getBaseVersion());
            $doubledSrc = $this->getThumbnailURL($type->getDoubledVersion());
            return '<img src="' . $baseSrc . '" data-at2x="' . $doubledSrc . '" />';
        } else {
            return $this->getTypeObject()->getThumbnail();
        }
    }


Any ideas you lovely helpful bunch of folks?!

dclmedia
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi dclmedia,

As an alternative, have you considered using the image helper?
dclmedia replied on at Permalink Reply
dclmedia
Hi MrKDilkington!

I have found a work around for this. What I have done is to call the base url for the image file and replace the word 'file' with the path for my own thumbnail images and then recreated the img src.
$(r.files).each(function() {
                        var temp_file_path = this.url;
                  var tpath = temp_file_path.replace("files", "files/thumbnails/property_manager");
                  var tpath2x = temp_file_path.replace("files", "files/thumbnails/property_manager_2x");
                  var newpath = '<img src="'+tpath+'" data-at2x="'+tpath2x+'">';
                            galleryEntriesContainer.append(_templateSlide({
                                fID: this.fID,
                                thumbnail: newpath
                            }));
                        });


I wasnt sure exactly how to manipulate the Image Helper to achieve my result using jQuery, any guidance you can give would be appreciated for knowledgable purposes...

Thanks once again for your assistance in one of my problems!