ameego
August 24, 2020, 7:40am
1
Hi there,
In the cms interface, clicking on the Media button populates the media modal but it states that “no assets are found”.
Here is a sample of config.yml.
media_folder: "static/assets"
collections:
- label: Artists
name: artists
fields:
- label: "Image"
name: image
widget: image
media_folder: "/static/assets/banner/{{fields.slug}}"
Images from artists collection are uploaded in “/static/assets/banner/my-artist/” for instance.
There are different image fields within this collection with media_folder pointing to different folder to keep things organized.
I would expect all images to be shown when user clicks on Media but it does not show any asset, probably because the media_folder at the root is pointing to “static/images” and not the actual paths where images are uploaded.
Is there a way to show all assets when clicking on Media button, regardless of the folder they are placed in (provided it’s under the path specified in media_folder at the root of config.yml?)
Cheers,
ameego
August 25, 2020, 1:33am
3
Apologies, there was a typo in my first post.
The root media_folder points to “static/assets” and the collection field points to "/static/assets/banner/{{fields.slug}}.
I wanted to keep the field media_folder in a separate folder to keep things organized.
Any idea?
Thanks,
ameego
August 25, 2020, 2:47pm
5
There’s one favicon.ico at the root of the static
folder. Changing the media_folder
to static
shows the favicon in the Media, but nothing else.
erez
August 31, 2020, 5:38pm
6
Hi @ameego and welcome to the community.
The global media folder doesn’t support directory navigation and shows only top level files.
We do have a feature request for it:
opened 03:00PM - 12 Feb 20 UTC
kind: feature
kind: discussion
status: needs design
area: media-library
area: ui
<!--
Please make sure that we do not have any requests for this feature already… open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please add a comment to the existing issue instead.
-->
**Is your feature request related to a problem? Please describe.**
<!--
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-->
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**
<!--
A clear and concise description of any alternative solutions or features you've considered.
-->
No support.
**Additional context**
Replaces #1046.
You should be able to see those files when opening the media folder when editing an entry.