The documents explain how to find a file by name:
image: page.image.findBy("name", "cover")
However, say I have a field named thumbnail
, is there a way to configure this section blueprint so that it uses the image from this field?
The documents explain how to find a file by name:
image: page.image.findBy("name", "cover")
However, say I have a field named thumbnail
, is there a way to configure this section blueprint so that it uses the image from this field?
Yes, you can use
image: page.thumbnail.toFile()
Just out of interest: what happens when the saved file doesnβt exist (anymore)? Will the panel display no image or does it break like in the frontend?
@thguenther No, it will fail silently and display either the icon defined with the icon
option or the default file icon.
Thank you as always for your prompt and dependable help @texnixe I had tried it but missed the brackets before.