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

[Media Library] Ability to work with folders #1046

Closed
ww7 opened this issue Jan 25, 2018 · 23 comments
Closed

[Media Library] Ability to work with folders #1046

ww7 opened this issue Jan 25, 2018 · 23 comments

Comments

@ww7
Copy link

ww7 commented Jan 25, 2018

Browse at first.

@tech4him1
Copy link
Contributor

@ww7 Can you explain in more detail?

@erquhart
Copy link
Contributor

Guessing this is about breaking assets into multiple folders instead of just the media folder. We're planning to solve this eventually with asset collections, but I don't think there's an issue for it yet.

@dudil
Copy link

dudil commented Feb 7, 2018

@erquhart - do you have a design or issue for assets collections? That means being able to put media in realtime path (inside static) to the collections?

I'll be happy to contribute that if it's in your plan or have an open issues about it (couldn't find one...)

@erquhart
Copy link
Contributor

erquhart commented Feb 8, 2018

@dudil that would be awesome. No design work has been done - do you work in design, development or both? I'm expecting to just have a vertical list of asset collections on the left side, which would map to folders, and you could specify for an image or file field which asset collections it could pull from.

I'll get a proper issue together.

@dudil
Copy link

dudil commented Feb 9, 2018

@erquhart - I'm more on the development side, but can handle simple design (copy paste mainly :) )
What I had was something more simple and maybe different.
To be able to override the media_folder and public_folder per collection
for example:

collections:
  - name: "blog" # Used in routes, e.g., /admin/collections/blog
    label: "Blog" # Used in the UI
    folder: "content/blog" # The path to the folder where the documents are stored
    media_folder: "static/images/blog/" # override for blog collection
    public_folder: "/images/uploads/blog/" # override for blog collection

BTW - if that could be changed to include also the parameter options, it will be even better something like {{slug}} etc.

What do you think about this?

@jimmyangel
Copy link

I like @dudil idea. It is pretty simple and straightforward.

I am going through the CMS right now and having to dump all the images in one folder is not very attractive. I like to have image subfolders in the various content folders -- like blog/images and galleries/galleryname/images, etc.

This change would be awesome!

@erquhart
Copy link
Contributor

erquhart commented Feb 27, 2018

We're talking about the same things, actually, I'm just tacking on the concern of making assets discoverable in the general Media Library interface, otherwise you'd have to navigate to a collection, open an entry, and click an image field to see the images in that folder.

That said, if you want to put together a PR for the change you're describing and multiple folders being used in the same config, that'd be a strong start.

@tomhamiltonstubber
Copy link

This would be really good. At the moment we can only use the CMS for our blog as I don't want to have the images for the blog, feature pages etc all in the same folder.

@tech4him1
Copy link
Contributor

@tomhamiltonstubber For something like that, a possibly viable workaround would be to create a different CMS instance for each part (blog, site, etc). If you want to discuss more, we can chat on Gitter: https://gitter.im/netlify/NetlifyCMS.

@raulcraveiro
Copy link

I would love to have the possibility to organize my media in folders like year and month.

@erquhart
Copy link
Contributor

erquhart commented Jun 6, 2018

Alright folks, trying to determine a minimal approach to satisfy most of what folks need from this feature. I'd expect those needs to be:

  • Allow multiple folders to be used
  • Allow nested folders
  • Allow users to create folders

Here's the lowest effort approach I could think of:

  • Keep accepting a single media folder in the config, as we do currently
  • Show a list of folders found within the media folder on the left side of the media library
  • Use breadcrumbs to track position in the hierarchy
  • Allow new folders to be created via an input after the last folder in the list with placeholder "new folder"
  • Allow folders to be deleted via a button that shows on hover of each folder
  • Folders must be empty to delete

Thoughts?

@jimmyangel
Copy link

It would be nice to be able to co-locate media folders in the same place as collections. For example, blog images go under the blog/images folder or even better under blog/{{slug}}/images folders.

@erquhart
Copy link
Contributor

erquhart commented Jun 7, 2018

@jimmyangel totally - would you mind opening a separate issue for that? It's been discussed many times, but I can't find an issue for it.

@marcojakob
Copy link

As has been mentioned by various people above, I've openend an issue for Assets Relative to Content.

@Destroy666x Destroy666x mentioned this issue Dec 6, 2018
@jimmyangel
Copy link

Question: are you guys still planning to add the ability to work with folders for images, instead of dumping all the images in one folder?

Thanks

@erquhart
Copy link
Contributor

Yes, but #1472 comes first.

@azicchetti
Copy link

Hi,
wouldn't be a super-simple and maybe temporary solution to implement the suggestions in #399, namely overriding the media_folder parameter in each collection or within the widget image scope?

The current setting, a single big directory for all the images, is probably scaring a lot of people away from the CMS

@michelef87
Copy link

Having media_folder and public_folder overridable at widget level would be perfect for most use cases...

@albertobissacco
Copy link

how is the status of this feature?

@erezrokah
Copy link
Contributor

With #1472 resolved you can set a media_folder on a collection which will be regarded as a relative path for media files based on the entry location.

Collection specific media files will not be shown in the "global" media library, but only when opening the media library from the editor.

More information here: https://www.netlifycms.org/docs/beta-features/#folder-collections-media-folder

@AbdifatahZamiir
Copy link

is there any one who can help me to structure media_folder and public_folder media_folder: static/images public_folder: /images after posting new blog the path of the image begins / and will be image: /images/cold-conifer-dawn-917494.jpg but my previous image path was like this ../../images/AfMiI.jpg and the error will be **Field "image" must not have a selection since type "String" has no subfields
** because there is no any data inside this field.

@erezrokah
Copy link
Contributor

erezrokah commented Jan 19, 2020

Hi @AbdifatahZamiir can you please open a new issue with your scenario? (share the config.yml and repo if possible so we can reproduce it).

@erquhart
Copy link
Contributor

This issue became about three separate issues, two of which are resolved:

For clarity, the third point will be covered under #3240.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests