Read user defined page status

Am I correct in saying that:

  1. There are three status options: “draft”, “listed”, and “unlisted”.
  2. “Draft” is always present, while “listed” and “unlisted” can be removed.

Example

# album.yml
status:
  draft: true
  listed: true

If I try to programmatically set “unlisted”, the panel will show an error because “unlisted” doesn’t exist.

Is there a way to find out which status settings are available for a page so that I can check for their presence?

Background

I am working on a feature that synchronizes the status of a parent page with its children. My goal is to unlist all child pages if the parent page is unlisted (or deleted).

Yes: $pageblueprint->status() | Kirby CMS

Awesome @texnixe!

Is this availbale at the $page object? Or do I need to load it before PageBlueprint::load(...) in order to get access?

I’m in a hook page.changeStatus:after and get the current page with $page = $event->argument('newPage');

$page->blueprint()->status();
1 Like

That was easy ^^ Thank you very much for helping me out!

1 Like