Ternary or logic on query lang?

Can i use some form of if/then logic or ternary operator in query language ? or should I go for a method?

I mean something like:

Payment complete: {{ page.paymentComplete ? 'yes' : 'no' }}

with paymentComplete storing boolean


Nope, that’s not possible. You can use just info: "{{ page.paymentComplete }}" which will print true/false. To print yes/no, you would indeed need a custom method.

Ah I see

It was actually printing “1” instead of true, perhaps because the field is set up like this:

        label: Payment Complete ?
        type: toggle
          - "No"
          - "Yes"

Actually… if I use -No -Yes those are treated as booleans, but then do not show as no yes, but as true false in the panel aswell, so if I want to have the cake and eat it, I need to go for a custom method