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

Directory navigation in the media library #3240

Open
erquhart opened this issue Feb 12, 2020 · 25 comments
Open

Directory navigation in the media library #3240

erquhart opened this issue Feb 12, 2020 · 25 comments

Comments

@erquhart
Copy link
Contributor

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 #1046 (comment):

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.

@andy-mcdonald
Copy link

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?

@erezrokah
Copy link
Contributor

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

@andy-mcdonald
Copy link

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

@erezrokah
Copy link
Contributor

erezrokah commented Mar 18, 2020

@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 :)

@erquhart
Copy link
Contributor Author

@andy-mcdonald woot!! 🎉

@bugii
Copy link

bugii commented Apr 13, 2020

Such a cool feature :) Any update on this?

@neilmorton
Copy link

This feature seems like a very important addition.

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

Thanks.

@erezrokah
Copy link
Contributor

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.

@neilmorton
Copy link

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

@surjithctly
Copy link
Contributor

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?

@franva
Copy link

franva commented Sep 6, 2020

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

@neilmorton
Copy link

@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. 👍

@franva
Copy link

franva commented Sep 7, 2020

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

@surjithctly
Copy link
Contributor

@franva I guess he meant the first comment of this issue where people did thumbs up 👍

@neilmorton
Copy link

@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

@franva
Copy link

franva commented Sep 7, 2020

thanks @surjithctly and @neilmorton I have thumb-upped this issue 👍

@andrew-paterson
Copy link

andrew-paterson commented Nov 27, 2020

@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?

@erezrokah
Copy link
Contributor

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 #2557 as I think it would be best to include this issue as a part of that effort.

@andrew-paterson
Copy link

I have created #4670 as a very small first step. I'd like to clarify a few things, which I have listed in the PR before continuing.

@5310
Copy link

5310 commented May 13, 2022

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 😊

@Schotsl
Copy link

Schotsl commented Feb 27, 2023

I would love this!

@ktully
Copy link

ktully commented Jun 11, 2024

It wouldn't address the arbitrary or nested subfolders use case, but has anyone considered changing the main media tab to bring up the same collections menu as Contents, when multiple media folders are configured against the content collections?

The media lightbox could then popup with the relevant directory view only after a content type was selected from the left menu. It feels like most of the code to achieve this should already exist, given the content editors do this under the hood today.

(A virtual content type would probably have to be added to the top of the menu representing the default global media location.)

@ktully
Copy link

ktully commented Jun 11, 2024

Alternatively, a global config option to optionally have the Media tab lightbox use the media folder for the currently selected content type.

@pktiuk
Copy link

pktiuk commented Aug 7, 2024

Issue linked with: #2113
(In that one a broken link to netifycms is posted as an answer)

@germs-at
Copy link

I want this too! Does it exist yet? Isn't that something everybody needs? TinaCMS has it!

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