Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Set another parent for images #124

Closed
patrickroeder opened this issue Oct 10, 2019 · 3 comments
Closed

Set another parent for images #124

patrickroeder opened this issue Oct 10, 2019 · 3 comments
Labels
type: feature ⭐️ Request or idea for a new feature

Comments

@patrickroeder
Copy link

As of now, the image block in the editor "pulls" image files only from the current page. It would be great to be able to set another parent for images, e.g. a different page or the entire site, the sort of stuff you can normally do using a query option for files fields in a page blueprint.

@bnomei
Copy link

bnomei commented Oct 11, 2019

if parent is set to another page uploading files in editor image block should be disabled?

@bastianallgeier bastianallgeier added the type: feature ⭐️ Request or idea for a new feature label Oct 11, 2019
@patrickroeder
Copy link
Author

My expectation was that a image block works similarly to a files field. Therefore I would probably implement it along the lines of how it already works for a files field, see: https://getkirby.com/docs/reference/panel/fields/files#upload-options__destination-and-template

So default is the current page, and a parent could be defined to set the upload destination. Tbh in my particular case I just disabled the upload button altogether because I could see no way to set a template for uploaded files, which in my case is essential.

So the gist of it is: Provide options like in a files field, with querying being the most essential option. Just a suggestion -- don't know how realistic/feasible it is to implement it.

@bastianallgeier
Copy link
Member

I think you will be happy to hear that all of this is already possible :)

fields:
  text:
    type: editor
    files:
      query: site.find("photos").files
    uploads:
      parent: site.find("photos")
      template: editor-image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature ⭐️ Request or idea for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants