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

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

Open
tangleMesh opened this issue Oct 20, 2021 · 1 comment
Labels
area: extensions/media-libraries area: media-library area: ux type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@tangleMesh
Copy link

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.

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

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.

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
But all of these images are not available in the media library during creation of a new pages in the example_collection:
image

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.

@tangleMesh tangleMesh added the type: bug code to address defects in shipped code label Oct 20, 2021
@erezrokah erezrokah added type: feature code contributing to the implementation of a feature and/or user facing functionality area: ux area: extensions/media-libraries area: media-library and removed type: bug code to address defects in shipped code labels Oct 20, 2021
@erezrokah
Copy link
Contributor

Is this behavior intended or is this a bug?

This behavior is intended, part of it since we don't support a nested directory structure in the media library (yet).
I think the main issue here is how to make displaying global and local assets not confusing to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: extensions/media-libraries area: media-library area: ux type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

No branches or pull requests

2 participants