Thumbnail's absolute URL
Permalink
Hi all,
I'm currently using:
To get the relative path to the thumbnail.
I'm wondering if it's possible to get the URL to the thumbnail instead.
So instead of /path/to/thumbail.jpg, i'm looking forhttp://www.example.com/path/to/thumbnail.jpg...
Thanks!
I'm currently using:
$ih = Loader::helper('image'); $img = $page->getAttribute('thumbnail'); $thumb = $ih->getThumbnail($img, 300, 9999, false); $thumb->src;
To get the relative path to the thumbnail.
I'm wondering if it's possible to get the URL to the thumbnail instead.
So instead of /path/to/thumbail.jpg, i'm looking forhttp://www.example.com/path/to/thumbnail.jpg...
Thanks!
Is there a specific reason for why you want the absolute URL?
The getURL() method can be used on the file object retrieved by $c->getAttribute('thumbnail') to get an absolute URL. This is the original file image though, not the thumbnail, so I am not sure if that is useful to you.
I don't think you can get an absolute path using the object returned with getThumbnail(). If you look at the method itself, src is $src = REL_DIR_FILES_CACHE . '/' . $filename;.
http://www.concrete5.org/api/source-class-Concrete.Core.Legacy.Imag...
http://www.concrete5.org/api/class-Concrete.Core.Legacy.ImageHelper...