Where are thumbnails stored please, as I would like to use a hyperlink to a small thumbnail?
When you say ‘use a hyperlink’ do you mean like an external link to a C5 website image that you could use on a second website? Could you elaborate on what you are trying to do?
i would like to link to a specific thumbnail image as i know concrete makes a number of different size thumbs.
Its so i can use it on a page in the same site, rather than having to make a separate smaller image for each use. I know images will scale in an image box according to the use, but i am adding images to another piece of html that is showing the image from a link.
Thanks.
Try something like this
<?php
use Concrete\Core\File\Image\Thumbnail\Type\Type as ThumbnailType;
$page = Page::getCurrentPage();
$linkImage = $page->getAttribute('linkImage'); // Change from bannerImage to linkImage
// Define default fallback image
$staticImage = $this->getThemePath() . "/images/default-image.jpg"; // Update with your fallback image
$src_large = $staticImage;
$imageURL = $staticImage;
if ($linkImage && is_object($linkImage)) {
// Get the thumbnail type
$thumbnailType = ThumbnailType::getByHandle('large'); // Change 'large' to your actual thumbnail handle
if ($thumbnailType) {
$src_large = $linkImage->getThumbnailURL($thumbnailType->getBaseVersion()) ?: $linkImage->getURL();
} else {
$src_large = $linkImage->getURL();
}
$imageURL = $linkImage->getURL(); // Full-size image URL
}
?>
<a href="<?= h($imageURL); ?>" target="_blank">
<img src="<?= h($src_large); ?>" alt="Linked Image">
</a>