The pages#Preview images example loading an image from the asset folder doesn’t seem to work with svg images.
It results in panel error message:
The section “sectionname” could not be loaded: The file::version component must return a File or FileVersion object
I reproduced it using a fresh starterkit:
- put an svg in
assets/images/test.svg
- load that svg in
model/album.php
:
class AlbumPage extends Page
{
public function cover()
{
return new Asset('assets/images/test.svg');
}
}
Result:
Seems that a svg asset doesn’t inherit from Kirby\Cms\FileVersion
or Kirby\Cms\File
.