But apparently between the {{ }} is not actual code execution (as I thought the documentation sugested by directly mirroring/copying the php Kirby API).
Should work with structures as well. Your method would then either return the number in parens or nothing and can be used instead of size in your query string. Not tested. And make sure you are on Kirby 3.4.x
I get how that can work (and it propably will do).
Not ideal for every situation considering for the select field for example one can define a text and value query. For the value property its best to either define a ‘final’ value, or an identifiable value (like number, or in this case type).
I think this can be enhanced with some kind of orElse implementation, but I’ll leave that up to the devs to decide Thanks for the alternative anyways!