Able to set path to upload folders directly on widgets #4706
Labels
duplicate
type: feature
code contributing to the implementation of a feature and/or user facing functionality
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:
{label: "Upload Image", name: "image", widget: "image" }
{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.
The text was updated successfully, but these errors were encountered: