decaporg / decaporg/decap-cms

When using "Folder Collections Media and Public Folder" the overall media library files are not shown

Open
#5,910 1 comment 1 reaction 0 assignees View on GitHub
area: extensions/media-libraries area: media-library area: ux type: feature
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

We have set up a netlify instance which in general works quite well. Therefore thanks for the great project!

As we have an own implementation of a static site generation, we prefer to keep the assets near to the documentation site (.md-file) as described [here](https://www.netlifycms.org/docs/beta-features/#folder-collections-media-and-public-folder).

To get this behavior we used the `media_folder` and `public_folder` options inside our collections. Eg.

```yaml
example_collection:
name: "example_collection"
label: "Example collection"
folder: "example_collection"
create: true
extension: "md"
format: "frontmatter"
summary: "{{dirname}}/{{filename}}.md"
slug: "netlify"
path: "cake-cms/netlify/{{filepath}}/{{slug}}"
fields:
- { label: "File path", name: "filepath", widget: "string", required: true }
- { label: "Title", name: "title", widget: "string" }
- { label: "Body", name: "body", widget: "markdown" }
nested:
depth: 5
summary: '{{slug}}'
media_folder: "assets/"
public_folder: "assets/"
```

But with this configuration the overall media_library is ignored.

```yaml
media_folder: "static/images/uploads" # Media files will be stored in the repo under images/uploads
public_folder: "/images/uploads" # The src attribute for uploaded media will begin with /images/uploads
```

As a result, you can upload media files in the overall media-library:
![image](https://user-images.githubusercontent.com/38432973/138047663-e2a30866-e400-4b72-8d0f-d6b39c5861fb.png)
But all of these images are not available in the media library during creation of a new pages in the `example_collection`:
![image](https://user-images.githubusercontent.com/38432973/138047821-59130251-b54b-4c4c-91bd-e248f18a0af4.png)

Is this behavior intended or is this a bug? Because in our use-case it would be gread to use overall-assets also in each collection together with the specific collection media assets.
Otherwise the overall media library would make no sence in our case.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.