Hi,
is there any easy solution to use files blocks while using kirby as headless cms? A few month ago the i could build a block exporter (there was a tutorial with how to generate a json file) an get at least the file name out of an image. Which was ok combined with the url of the block post.
Today i just can get a cryptic hash value… I guess its great if kirby is used a cms with pure php. But in my case it is really a pain. For better understanding:
I want to use Kirby for some kind of Webapp and build a kind of database with materials. To get the data i build a custom json template (which is faster than using the api)
<?php
$materialsInput = $pages->template("materials");
$materialsOutput = [];
foreach ($materialsInput->children() as $entry) {
$sub = array(
"headline" => $entry->headline()->value(),
"subline" => $entry->subline()->value(),
"json" => json_decode($entry->json()),
"blocks" => json_decode($entry->text())
);
array_push($materialsOutput, $sub);
}
echo json_encode($materialsOutput, JSON_HEX_QUOT | JSON_HEX_TAG);
cool that was a pretty easy template. But if i use image blocks i wont get the real url, but some kind of?:
{
...
"content": {
"images": [
"file://PC6r3uU7P1JJK1a4",
"file://HEZWeQzqkspijRK5",
"file://V3KL7PspVYxydxI0",
"file://vpqvSwjFKRds8Omu"
],
"caption": "",
"ratio": "",
"crop": "false"
},
"id": "39f8122b-7e52-4b78-a71a-565d8025aeb3",
"isHidden": false,
"type": "gallery"
},
....
so ist it possible to get real urls, whitout building a kind of extra logic to parse all image blocks? otherwise kirby (which was so far really one of the best cms i have worked with) would become a little bit useless.