Displaying only emebdded pictures in a panel's file section

Hey There!

I’m very new with Kirby and CMS in general, I am working on an existing and implemented Kirby-System.

[old state]: The old (unwanted) state of that system was, that a Site in the Panel of the Kirby backend inherits behavior from page: “preset: page” line in the blueprint. So at the righ-hand side of each panel, there is a field for fileuploads, but with distributed and for each subsite unique images.

[first iteration]: I was then supposed to implement a central solution for files so that all images have to be uploded only once. Also the files will be saved in a central folder named ‘gallery’ within the contet folder. I managed to do that by implementing a seperate (unlisted) site. Every other site now inherets the picures by two lines:
“files:
parent: site.find(‘gallery’)”
As a result, all images of the whole website are shown in the fileupload field.

[problem task]: But this is not yet the final desired behavior that I am supposed to implement.
The fileupload is expected to show the inherited pictures of the gallery - but only those which are mentioned in the textarea.
To embed an image “picture.png”, one will have to upload it to the central gallery, go to the site panel of choice and manually type into a text field “(image: picture.png)”. After that, the picture is supposed to appear in the fileupload field (automatically).

My questions related to this task:
Is there a way to implement this in the blueprints? Or is it neccassary to step in the Kirby-System itself?
Is there a Documentation or something I can read to solve this task?

Thank you for helping me out, I am happy about any comments or even pointers you can give me :blush:

That’s not possible out of the box. To achieve this, you would have to parse the text, find the images used there, then display them in the section using a custom files section that allows a query ( a plugin for this exists).
But why to the files have to be displayed in such a section at all?

You could improve the workflow of uploading images by setting the upload option for the textarea field to upload to the gallery page and also be able to select an image there, rather then manually inserting the image tag.

1 Like