Hi,
when I remove all images but one, then all removed images still appear in my slideshow. Any idea why?
I want images that don’t exist in the folder, to be not shown in the gallery, but they still appear because thumbs.php doesn’t sync the cache if file was removed.
Here’s the responsible code snippet:
<?
$images = $page->images();
$fit = 'fill'; $width = '600'; $height = '300'; $thumbwidth = '72'; $thumbheight = '72';
if ($page->hasImages() && isset($images)): ?>
<div class="thumbs">
<div class="fotorama fotorama-box-shadow" data-auto="true" data-auto="false">
<?
foreach($images as $image)
{
$caption = ( $image->caption() != '' )? kirbytext($image->caption()) : '';
$caption_data = ($caption != '') ? ' data-caption="'.$caption.'"' : '';
$img_url =
thumb($image, array(
'width' => $width,
'height' => $height,
'crop' => true,
'class' => "$fit",
'alt' => strip_tags($caption)
), false);
$full_url = thumb($image,
array(
'width' => 1920,
'height' => 1080,
) , false);
$landscape =
sprintf(
'<a href="%s" data-full="%s"%s></a>',
$img_url, $full_url, $caption_data
);
echo $landscape.chr(10);
}
?>
</div>
</div>
<? endif ?>
So if checking via $page->hasImages() && isset($images)) is wrong, how do I only show thumbs for those images that still exist in this directory??