Hi,
I use the KQL plugin to get data from a JSON. When I query blocks, I don’t see the URL from an image blocks. How to get the image url?
The equivalent in PHP to :
<?php if ($image = $block->image()->toFile()): ?>
<?= $image->url() ?>
<?php endif; ?>
This is what my JSON file return from the image block (“Kirby” location selected) :
{
"blocks": [
{
"content": {
"location": "kirby",
"image": [
"plage.jpg"
],
"src": "",
"alt": "",
"caption": null,
"link": "",
"ratio": "",
"crop": "false",
"classatt": "",
"idatt": ""
},
"id": "4171a968-1c1b-41b4-b42d-87c2ac9f922f",
"isHidden": false,
"type": "image"
}
],
"id": "a8d111bf-d281-4c0c-b4be-609f507bac08",
"width": "1/3"
}