waffl
December 10, 2019, 8:51am
1
I was wondering if there’s a way to show a select based on the number of files in a field like so:
files:
type: files
display:
type: select
when: files.count > 1
options:
inline: Inline
gallery: Gallery
I was wondering if I am doing this wrong or if it just isn’t possible?
texnixe
December 10, 2019, 8:59am
2
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
waffl
December 10, 2019, 9:03am
3
texnixe
December 10, 2019, 9:03am
4
Yes, extending the select field in this case.
Is this still true? I want to show a field only if a field of the same page isn’t empty, e.g.
sidebar:
width: 1/3
sections:
fields:
type: fields
fields:
info:
type: info
text: "Diesen Beitrag <a href='{{ page.facebook_url }}' target='_blank'>auf Facebook</a> öffnen."
when:
facebook_url: true
date:
type: date
files:
type: files
bnomei
November 7, 2025, 9:33am
7
GitHub - rasteiner/k3-whenquery: Conditionally show fields and sections. Better. can do stuff like that, but since it is JS-based a malicious panel user can circumvent it and still read and write to all fields.
I didn’t post a link to the plugin because I don’t think it is still compatible with current versions of Kirby, plus it has been removed from the plugins’ directory.