I am not sure if this is a setting or intentional but I cannot access/reuse image from a file field (cover/hero image) in an image block when post is in draft. Also I cannot search for the image or find it in the popup when clicking “select” in that same file field.
Upload image in file field.
Remove the image from the field
Click select and then search for the file. It does not appear.
Publish the post
Click select and then search for the file. It now appears.
I believe the draft is the reason for it to not appear. Since it does not appear I cant reuse the image in the block editor.
Perhaps I was too quick. I tried searching the docs for “childrenAndDrafts” as this site.pages.childrenAndDrafts.images returns “Your query must return a set of files”
I can see the that childrenAndDrafts works with $site or $page so not sure how to get this working.
I am sorry but my experience with Kirby is sadly limited.
That is because $pages doesn’t have a childrenAndDrafts() method ;), that’s only a method of a single page.
So you have two options, depending on what exactly you want to achieve. The simplest of which would be to use index(true) instead of children(). The second option a custom pages method.