Hello everyone,
I recently updated a project from Kirby 2 to Kirby 5. Since the update, images in my template are not loading correctly — in both the frontend and the panel they appear as “broken links.” After reloading the page or the panel, they sometimes display correctly. It seems the files are only added to the Media folder after a reload.
Setup:
-
Kirby 5
-
LazySizes for lazy loading
-
Media folder permissions set to 775
-
Thumbnails generated via
$img->resize(...)->url()directly in the template -
Blueprint: Structure field containing files
-
In the frontend I use
<img class="lazyload" data-srcset="..." ...>
Problem:
-
Images often only appear after multiple reloads
-
Removing LazySizes prevents the images from showing at all
Already checked:
-
Media folder permissions (775)
-
Config:
'thumbs' => ['driver' => 'gd'] -
Debug mode is enabled; no console errors
Question:
Has anyone experienced why images from structure fields sometimes don’t load in Kirby 5 or aren’t correctly saved to the Media folder? Do I need to change the template, or is there specific update behavior with LazySizes / Media folder I should be aware of?
Thanks in advance!