Hi, Iām using Kirby as an API to serve JSON for a web-app.
My API is a top-level page. I get pages based on the request path, then I loop through the content fields as an array and apply kirbytext() to textarea fields like so :
foreach($page->content($lang)->toArray() as $key => $value) {
if (strpos($key, '_html') !== false) $value = kirbytext($value);
...
}
But the output just uses the site root for the image path
<figure><img src=\"http://127.0.0.1:8010/bears.png\" alt=\"\"></figure>
Kirby Info:
Toolkit version: 2.5.1
Kirby version: 2.5.1
Panel version: 2.5.1