decap-cms icon indicating copy to clipboard operation
decap-cms copied to clipboard

Directory navigation in the media library

Open erquhart opened this issue 5 years ago β€’ 24 comments

Is your feature request related to a problem? Please describe.

This feature would be extremely useful in general, but is a requirement for the following common use case:

  • A markdown collection has existing entries
  • Images in the bodies of those files come from multiple directories
  • The best the CMS can do currently is show one configured directory in the media library for the entire collection
  • Images that are not sourced from the configured directory aren't visible
  • Even if we made it so they were visible, the directories they point to are still inaccessible from the media library

Describe the solution you'd like

For sites of any complexity, Eg., large existing open source docs sites, which Open Authoring was created for, navigating directories in the media library is a necessity.

From https://github.com/netlify/netlify-cms/issues/1046#issuecomment-395206762:

Requirements

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

Proposed approach

  • 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

Describe alternatives you've considered

No support.

Additional context

Replaces #1046.

erquhart avatar Feb 12 '20 15:02 erquhart

We're building a content portal for a client, where different publishing partners would add articles to their own collections. Each publisher should only be able to see their own content, but our client should be able to see everything. To accomplish this, we're going the route of creating multiple CMS instances, each configured to access only a subset of the content files - seems to work like a charm... except when it comes to the media library.

If I set the media_library to /static/assets/<publisher-name> then each publisher can only see the images they upload - good. For the client, I'd want to set the media folder to /static/assets and have all the sub-folders in that directory appear.

@erquhart - Sounds like this would be totally possible based on your description above. Is this likely to drop anytime soon? I could potentially get one of my developers to help out if you have a clear solution in mind?

andy-mcdonald avatar Mar 18 '20 05:03 andy-mcdonald

Hi @andy-mcdonald, we try to work our way through the most up voted issues first, but of course open to any contribution.

Currently we list media files based on the media folder up to a depth of 1, but that can be changed (example for GitHub) here: https://github.com/netlify/netlify-cms/blob/2409323dba1abe8a670d18453369fd75c6e240fb/packages/netlify-cms-backend-github/src/implementation.tsx#L377

Media library components can be found here: https://github.com/netlify/netlify-cms/tree/2409323dba1abe8a670d18453369fd75c6e240fb/packages/netlify-cms-core/src/components/MediaLibrary

Another option it to incorporate it into the general UX overall here

erezrokah avatar Mar 18 '20 09:03 erezrokah

@erezrokah - Thanks for the update, we'll look into this alongside some of the other contributions we'd like to make.

andy-mcdonald avatar Mar 18 '20 19:03 andy-mcdonald

@andy-mcdonald, if you do start actively working on something, please let us know so we can assign it to you so people know it is taken :)

erezrokah avatar Mar 18 '20 19:03 erezrokah

@andy-mcdonald woot!! πŸŽ‰

erquhart avatar Mar 18 '20 22:03 erquhart

Such a cool feature :) Any update on this?

bugii avatar Apr 13 '20 07:04 bugii

This feature seems like a very important addition.

Is anyone actively working on this? Any view on timescale?

Thanks.

neilmorton avatar Aug 21 '20 14:08 neilmorton

Hi @neilmorton, Netlify CMS is a community driven project, this is not on the radar at the moment but we would love a contribution for it.

erezrokah avatar Aug 26 '20 09:08 erezrokah

Hi @erezrokah, thanks for the heads up. I'd be interested if @andy-mcdonald did anything with this.

neilmorton avatar Aug 26 '20 09:08 neilmorton

I think this is a must have feature for netlify cms, since in most big projects, images are organized in subfolders.

I know this can take some time to implement. But is it possible to prioritize this?

surjithctly avatar Aug 26 '20 14:08 surjithctly

hit the same need. Hopefully we can see this feature soon~!

franva avatar Sep 06 '20 00:09 franva

@franva and @surjithctly if you haven’t already, make sure to up vote the original post, as they tend to work on the most up voted issues first. πŸ‘

neilmorton avatar Sep 06 '20 07:09 neilmorton

sure @neilmorton what's the original post? so do you mean that we already have this feature implemented? I'd love to see it~!

franva avatar Sep 07 '20 01:09 franva

@franva I guess he meant the first comment of this issue where people did thumbs up πŸ‘

surjithctly avatar Sep 07 '20 04:09 surjithctly

@franva, as @surjithctly has mentioned, add a thumbs up πŸ‘ to the first comment on this issue here if you haven't already done so.

The feature hasn't been implemented, but issues with more thumbs up πŸ‘ tend to get chosen for action.

Thanks @surjithctly

neilmorton avatar Sep 07 '20 09:09 neilmorton

thanks @surjithctly and @neilmorton I have thumb-upped this issue πŸ‘

franva avatar Sep 07 '20 10:09 franva

@erquhart having had a cursory look at the code, I would like to make an attempt at this, unless someone else is currently working on it?

andrew-paterson avatar Nov 27 '20 15:11 andrew-paterson

Hi @andrew-paterson, we would love a contribution for this. Please know that this will require a fair amount of work. Regardless I recommend looking at https://github.com/netlify/netlify-cms/issues/2557 as I think it would be best to include this issue as a part of that effort.

erezrokah avatar Nov 30 '20 13:11 erezrokah

I have created https://github.com/netlify/netlify-cms/pull/4670 as a very small first step. I'd like to clarify a few things, which I have listed in the PR before continuing.

andrew-paterson avatar Dec 02 '20 14:12 andrew-paterson

It's been a while since there's been any activity on this. Are you guys still planning to add filesystem navigation in the media library? It'd really help nested collections reuse assets for subpages :blush:

5310 avatar May 13 '22 09:05 5310

I would love this!

Schotsl avatar Feb 27 '23 15:02 Schotsl