I’ve got a structure field with logo’s, a field with a png and a field with an eps both fields can only contain one file.
I’m outputting the png files as expected, for example the filename:
$item->image()->toFile()->filename()
For the eps file, i get an error:
$item->eps()->toFile()->filename()
error: Call to a member function filename() on null
But this gives me an object:
dump($item->eps()->toFile())
Kirby\Cms\File Object
(
[dimensions] => Array
(
[width] => 0
[height] => 0
[ratio] => 0
[orientation] =>
)
[exif] => Array
(
[camera] => Array
(
[make] =>
[model] =>
)
[location] => Array
(
[lat] =>
[lng] =>
)
[timestamp] => 1684231856
[exposure] =>
[aperture] =>
[iso] =>
[focalLength] =>
[isColor] =>
)
[extension] => eps
[filename] => s4s-logo.eps
…
But how can I output the filename for example?