Where does the Kirby API fetch its information about pages and content

Hey :slight_smile:

I want to implement a new version of my automatic translation program, and this time I want to use the Kirby API and some control mechanisms to fully automate the process. So far I have no major problems in controlling the API, but I have a problem I am not sure how to deal with it.

For reference, first some data:

Currently, I want to use the following API endpoint to get the content of my blog:
=> api/pages/blog/children?limit=2&select=id, title, content, status, blueprint&page=1

With this query I get both the file content and the corresponding blueprint - I want both because if I make any changes to my blueprints the β€œold” files are not updated, so I want to do this with the API using the default values of each field in the blueprint (if the field does not already exist in the file). However, if I look into the files manually (using a text editor of my choice) - the field (e.g. enable_translation) is missing. But if I fetch the file with the Kirby API, the field is shown as existing (which is clearly not the case because the file was created before the blueprint contained this field and the editor shows that there is no field with this name).

So my question is, is this intended behavior? - and if so - can I deactivate this somehow and get a β€œlive view” of my files?

Thank you for your help :slight_smile:

Why can’t you check if the field contains content rather than if the field is present?

The content is always the default value ^^ - So I dont know if there is just no setting yet or if it is missing

I see, yes, makes sense, as the API was primarily created for the Panel, and in this case the form needs to be prefilled with the default value when a new page is created, see /kirby/config/api/models/Page.php`.

I see - Guess I need to build my own endpoint for this ^^ - Thank you as always :smiley: