Automatically fill in pages field

Is there a way that a “pages” field in the backend is always automatically updating and selecting pages based on their children pages contents?

A little example:
I have a page in the backend in which I can select via the “radio” field if this page is a building, car, phone or a pc - Lets call this page Resultpage

Now on the Parentpage of the Resultpage I would love to have a pages field that automatically has all Resultpages listed that are buildings, a pages field for all cars, a pages field for all phones etc…
So if I would to change the category of a Resultpage the pages fields on the Parentpage would update accordingly without me having to manually update these fields.

Is there a native way in Kirby for doing this?
Or would I have to write some kind of hook that triggers everytime a page in the Backend is updated?

Why does it have to be a field? Field content is stored in the content text file. If you want to update that, you’d have to use a hook.

1 Like

In my case it has to be a field because it has to be instantly noticeable to which category a Resultpage belongs to without having to open every Resultpage and looking it up, since the frontend users create these pages and administrators in the backend need a sorting kind of system.

And since there are currently only 3 types of page statuses natively shipped with kirby I would either have to create a plugin for custom statuses or create said hook.

But if you use sections instead of fields, you would have the same effect without storing anything. There is a custom section plugin that supports filtering, so you could have a section for each type of page.

1 Like

Oh my… That saves me alot of work :smiley:
As always thanks :smiley: