Page()->content() is `null` in custom API response

Great, so I think now this triggers the pages collection being resolved via https://github.com/getkirby/kirby/blob/main/config/api/collections.php#L36-L40 which states that it should use the compact view for each page. Which is defined here https://github.com/getkirby/kirby/blob/main/config/api/models/Page.php#L45-L51 and matches with what you posted.

I think you should be able to change this by sending along a query parameter in your request: view with the value of any of the predefined views in https://github.com/getkirby/kirby/blob/main/config/api/models/Page.php or select with a list of the fields defined in https://github.com/getkirby/kirby/blob/main/config/api/models/Page.php,

So for example: select=title,url,content

1 Like