Hello,
following situation I want to a achieve:
I have a blueprint with a layout field. Inside this layout the user can place an image. I used the standard kirby image block inside the layout field like this and works fine:
portrait:
type: layout
label: Portraitbilder
layouts:
- "1/4, 1/4, 1/4, 1/4"
fieldsets:
- text
- image
Now I want to extend the image block to add a specific uploads template. So the user can upload images but with the template it get converted to webp and 400x400px. My idea was this:
portrait:
type: layout
label: Portraitbilder
layouts:
- "1/4, 1/4, 1/4, 1/4"
fieldsets:
- text
- type: image
extends: blocks/image
fields:
image:
label: field.blocks.image.name
type: files
query: model.images
multiple: false
image:
back: black
uploads:
template: blocks/files/portrait
when:
location: kirby
Inside the folder site/blueprints/blocks/files/ I created the portrait.yml with following content:
title: Portrait
accept:
extension: jpg, jpeg, webp
create:
width: 400
height: 400
crop: true
format: webp
but this doesn’t work
So is my idea even not possible? Or what would be the way to go to get it to work?
Thanks and regards,
Timo