I have a files field in my blueprint like:
fields:
dateien:
label: Datei
type: files
width: 1/2
in the corresponding snippet this works and it throws the file name(s):
<?php foreach($data->dateien() as $files): ?>
<?php foreach($files as $file): ?>
<div><?=$file?></div>
<?php endforeach ?>
<?php endforeach ?>
but this should also work, but doesn’t
<?= $data->dateien()->first()->filename() ?>
I get the error “Call to a member function first() on array”
There should be only one file, so I don’t want to loop over all of them and if there are more, I just want the first file.
Any ideas?
Thanks
Hagen