Hi,
I try to make a field only visible in a File Blueprint if the file is an image. Any suggestions, how can I achieve this? (Restricting the file upload to images only is not an option, other files are allowed as well.)
The $file->type() == "image"
($file->type() | Kirby CMS) condition works well to distinguish images from other files, but I can’t figure out how to add it to a when
field condition. (Fields | Kirby CMS)
This does not work:
when:
type: image
I tried creating a field method in a plugin (File methods | Kirby CMS) to create a binary method and use it as part of the condition, but this didn’t work either:
when:
isImage: true
Thanks!