So I have a website with lots of images. And sometimes images are uploaded for a project, but then a news post would re-use that image. Or another unrelated page would re-use an image that was uploaded in a news post.
I was thinking a solution could be that for all images, a new image can be uploaded, or one one selected that is already uploaded.
I have this blueprint:
site/files/image.yml
# Each file blueprint must have a title, the title may be different from the file name
title: Image
# Like page blueprints, file blueprints can define a layout with tabs, columns, sections and fields
# File blueprints define what sort of information should get stored in a file's meta data file
# In addition to the fields defined in this example blueprint, you can also set what type of file is acceptable
# when this blueprint is used, which allows you to control what users can upload.
# More about file blueprints: https://getkirby.com/docs/reference/panel/blueprints/file
query: site.index.images
accept:
type: image
columns:
- width: 1/2
sections:
content:
type: fields
fields:
caption:
label: Opschrift
type: textarea
size: medium
alt:
label: Alt text (beschrijving van de afbeelding)
type: text
- width: 1/2
sections:
meta:
type: fields
fields:
link:
label: Link
type: text
icon: url
However I do not seem to get the option to search for an image when making a post or page with an image.
Is there a way to achieve what I’m after? Or is it a very dumb idea to always query all the images on a website every time you want to add one? (I can image that there may be performance issues.)