Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Able to set path to upload folders directly on widgets #4706

Closed
thedelanyo opened this issue Dec 11, 2020 · 1 comment
Closed

Able to set path to upload folders directly on widgets #4706

thedelanyo opened this issue Dec 11, 2020 · 1 comment
Labels
duplicate type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@thedelanyo
Copy link

thedelanyo commented Dec 11, 2020

In my NetlifyCMS config file, I have the following:

Globally:
media_folder: "src/images/upload"
public_folder: "images/upload"

Then in the my collections under fields, I can do something like this:

{label: "Upload Image", name: "image", widget: "image" }

{label: "Upload PDF", name: "pdf", widget: "file" }

Per this configuration, when I published a content, both the PDF file and the image file would be uploaded to src/images/upload. Which is fine.


But I believe this feature can be made better by specifying path to upload folders directly on widgets.

For instance:

After specifying media_folder and public_folder globally, we can also do this:

  1. {label: "Upload Image", name: "image", widget: "image" }

  2. {label: "Upload PDF", name: "image", widget: "file", path: "/path/to/upload" }

The first one will default to the global setting, which is the path to the public_folder (or media_folder).

The second one will now take the new path being specified on its widget, which is now its own path.

This is because, on most occasions, we do separate images from other assets. Even most developers would love separating some images from others.

@thedelanyo thedelanyo added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Dec 11, 2020
@thedelanyo thedelanyo changed the title Able to set folders per file Able to set path to upload folders directly on widgets Dec 11, 2020
@erezrokah
Copy link
Contributor

Hi @delanyodevio thank you for opening this issue. I believe this is a duplicate of #3201 and is already implemented, just not documented https://github.com/netlify/netlify-cms/issues/3671

There is a PR that tries to improve that #4705

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

No branches or pull requests

2 participants