Wiredcraft / jekyllpro-cms

A lightweight CMS for Jekyll websites.
http://jekyllpro.com/#cms
MIT License
7 stars 2 forks source link

default folder for image update #59

Closed haishanh closed 7 years ago

haishanh commented 7 years ago

Follow discussion with @hunvreus

Currently while you open the upload image modal, it displays the root level file structure of the repo, and your image will be uploaded to the root folder. You have to choose the destination folder manually.

Maybe we should set a default image upload folder for a collection.

For example, for posts we default the upload folder to images/posts, for article we default to images/article

hunvreus commented 7 years ago

Actually I'd like to be able to set it in the schema.

woodpig07 commented 7 years ago

This was done in PR #72 You can specify the default upload folder("ui:options": {"file_dir": "<folder_path_here>"}) in schema file, for example

...
"uiSchema": {
 "body": {
   "ui:widget": "customCodeMirror",
   "ui:help": "Description of the product",
   "ui:options": {
     "file_dir": "images/products"
   }
 },