Possible to show field based on number of files?

I was wondering if there’s a way to show a select based on the number of files in a field like so:

  type: files
  type: select
  when: files.count > 1
    inline: Inline
    gallery: Gallery

I was wondering if I am doing this wrong or if it just isn’t possible?

No, that’s not possible. You can only use conditional fields with actual values in other fields like described in the docs. There are, however, several requests to extend such conditions in the ideas repo you might want to upvote.

Another option is a custom Panel field.

1 Like

Thank you @texnixe - by this do you mean a custom field plugin? https://getkirby.com/docs/reference/plugins/extensions/fields

Yes, extending the select field in this case.