Field shows when page status is unlisted

Hey,

Is it possible to hide/ show fields in a blueprint depending on the page status?

I have a blue print for each project on my site and when the status is changed from listed to unlisted, it is archived in the website layout. I would like to add an end date field that appears on these archived project pages. Ideally, i would like to only display this field in the blueprints when the status of the page is changed.

i tried two options with when using, (1) when and status and (2) when with a query

          startDate:
            label: Project Start
            type: date
            width: 1/4
            display: MMM YYYY
            when:
              status: listed
          endDate:
            label: Project End
            type: date
            width: 1/4
            default: today
            display: MMM YYYY
            when:
              query: page.status('unlisted')

thanks in advance

No, that is not possible. The when option only works with field values. A workaround could be to use a page.changeStatus:after hook to store the new page status in a (hidden) field in the content file, then use this field in the when option.

1 Like

Thank you!