I can choose there if I want to get an global img or an img from the site.
the only difference is that I added a query to image global.
name: image global # no need i guess
fields:
image_global_data:
type: files
query: site.images #queries global images
layout: list
uploads:
template: image
image:
ratio: 1/1
cover: true
All of this works fine!
When I choose image global it shows only the global images query: site.images #queries global images
But when I upload it uploads the img to the page…
How can I define that it should upload the images to the site as well?
But you can only define one upload destination, not multiple, so either - or. If you really need the files in both destinations, you would have to use an file.upload:after hook to actually copy the file to another destination.
So do I understand it right that I only can use one upload option a page?
And not different upload destinations for two different page builder file blocks?
To bring it to the point:
I have two different file templates in my backend. One for page images and one for global:
The page Template:
name: image page # no need i guess
fields:
image_page_data:
type: files
layout: list
uploads:
template: image
image:
ratio: 1/1
cover: true
and the global template:
name: image global # no need i guess
fields:
image_global_data:
type: files
query: site.images #queries global images
layout: list
uploads:
template: image
image:
ratio: 1/1
cover: true
now I want, if I upload an img “in” the global template I want to store the img global
and if I upload an img via the page template to be stored in the page itself.
Same like: if I select an img from page template I get only the images already stored in the page and if I select an img from global template I get only the images stored on the site itself (globally). I want the same with uploading the imgs
So that in the end I could upload images in my subpages but make it globally accessible.