I’m trying to change a label text between singular and plural depending on how many items there are in the ‘structure’.
I’ve tried so far to look at Ternary operator but it’s beyond my experience.
Here is what I have tried so far:
label: "{{ page.clients.toStructure.count.not(1) ? 'client' : 'clients' }}"
and the full structure code:
fields:
clients:
label: "{{ page.clients.toStructure.count.not(1) ? 'client' : 'clients' }}"
type: structure
fields:
clientname:
label: name
type: text
clienturl:
label: website
type: url
clientinstagramhandle:
label: instagram
type: text
categories:
type: structure
fields:
category:
label: Project categories
type: text
Any suggestions or hints would be greatly appreciated.
Kirby: 4.1.0
PHP: 8.3.3
Browser: Safari 17.3
OS: Mac 14.3