Select image from all images I ever uploaded

Hi there

I have a subpage where I can add images. Either selecting or uploading.

What I would like to have, is the possibility to select images from ALL images I ever uploaded to this whole page (subpages, parent pages, does not matter. Just give me access to the whole media folder). Otherwise I have to reupload…

Is this even possible, or does having the same image on two pages mean, that I need to upload the image twice?

I tried to find questions that already address this issue, but could not find a proper solution (Maybe solutions with fetch: images, but I don’t quite understand this.

Thanks for some input on this…
Cheers

The alternative is to use a separate folder (in /content) for all images and set your blueprint’s textarea, files fields and files section to upload to/query from this folder.

1 Like

Ok, sounds good. Thanks for the quick reply. How would I refer to this folder (respectively how would I tell the blueprint to upload and fetch files from there?

Here is an example for a files section:

files:
  type: files  
  label: Banner Image
  type: files
  max: 1
  options: query
  query: site.find('mediastore').images
  layout: cards
  size: medium
  uploads: 
    parent: site.find('mediastore')
    template: image
  image:
    back: white
    cover: true
    ratio: 1/1

A files field:

fields:
  cover:
  type: files
  query: site.find('mediastore').images

Textarea field:

textarea:
  type: textarea
  files:
    query: site.find("mediastore").files.template("textarea-upload")
    image:
      cover: true
  uploads:
    parent: site.find("mediastore")
    template: textarea-upload

In each case, the page folder is called mediastore.

2 Likes

Thank you. I will try this out soon.

Hi,

I am trying to implement this and I managed to make it partly work.

When I upload an image on a page where the textarea is declared like that, the image ends up in the mediastore folder. Perfect.

But I would like to have a tab on the site blueprint where all the images in the mediastore folder are showing. And nothing is showing up, even though there are files in the mediastore folder.

  • The mediastore folder site in content/
  • The tab in the site blueprint uses the code you have for the files section

The tab does show images that are loose in the content folder. It seems to ignore the find bit and only looks in site for images.

Any ideas?
Thank you.