Hello,
i use Kirby as Headless and NUXT in the frontend.
If i use the thumb function in the query, kql still response with the org. image size and not with the resized and cropped file.
I tried different typos but non seems to be correct.
Is it not possible to use this function?
const { data } = await useKql({
query: 'page("home")',
select: {
id: true,
title: true,
...
exposes: {
query: 'page("exposes").children.listed',
select: {
id: true,
title: true,
image: {
query: 'page.images.first',
select: {
thumb: {
query: "file.thumb(1200, 1200, true)",
},
alt: true,
},
},
},
}
},
});
I also tried:
const { data } = await useKql({
query: 'page("home")',
select: {
id: true,
title: true,
...
exposes: {
query: 'page("exposes").children.listed',
select: {
id: true,
title: true,
image: {
query: 'page.images.first',
select: {
thumb: {
query: "file.thumb([1200, 1200, true])",
},
alt: true,
},
},
},
}
},
});
All other variants threw errors.
The response is in both cases:
{
"thumb": {
"extension": "jpg",
"filename": "bildschirmfoto-2024-04-17-um-18.47.41.jpg",
"height": 1500,
"id": "exposes/designer-anwesen-in-traumhaftem-garten/bildschirmfoto-2024-04-17-um-18.47.41.jpg",
"mime": "image/jpeg",
"niceSize": "805,07 KB",
"template": "imageExposeHead",
"type": "image",
"url": "http://api.rh-homes.test/media/pages/exposes/designer-anwesen-in-traumhaftem-garten/328f25d766-1713372787/bildschirmfoto-2024-04-17-um-18.47.41.jpg",
"width": 2100
},
"alt": "",
"url": "http://api.rh-homes.test/media/pages/exposes/designer-anwesen-in-traumhaftem-garten/328f25d766-1713372787/bildschirmfoto-2024-04-17-um-18.47.41.jpg"
}
I also changed the size of the thumb to prevent, that the thumb has already been created.
Thanks in advance.