Create a conditional field based on page status

Hi there–

Is it possible to create a conditional field based on the status of a page?
I want to create a grid overlay that would only have the option to be enabled while the page is in “draft” mode. Something like this:

gridToggle:
        label: Layout Grid
        type: toggle
        when: "{{ page.status }}" = "draft"

I have not been able to get this to work through trial and error and can’t find much documentation about conditionals in the docs. Is this possible to achieve?

Also tried hacking it by piping the page status through a field w no avail, ex:

   Status: 
        type: text
        placeholder: "{{ page.status }}"
        text: "{{ page.status }}"
   Toggle:
        label: Show Layout Grid
        type: toggle
        when: 
          Status: draft

No, that’s not possible. Conditional fields are always based on the value of other fields.

Going through an additonal field will work, if you give it a value, i.e. a default value when the page is created (pages are always created in draft status) and then change the value in a page.changeStatus.after hook. You can even make that field hidden, if you want.