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

Validation Error When Using Only Relative Media Directories #3670

Closed
Undistraction opened this issue Apr 27, 2020 · 4 comments
Closed

Validation Error When Using Only Relative Media Directories #3670

Undistraction opened this issue Apr 27, 2020 · 4 comments

Comments

@Undistraction
Copy link
Contributor

Describe the bug
The beta docs here outline how collection-specific media_folder keys can allow you to use relative paths. This effectively removes the need for a global media_folder key. However it appears this is still being validated as a required key.

Error loading the CMS configuration
Config Errors:
config should have required property 'media_folder'
config should have required property 'media_library'
config should match some schema in anyOf
Check your config.yml file.

I think there might be some kind of conflict between local and global dirs causing the bug I have outlined in #3654 which is why I removed the global dir.

To Reproduce

Expected behavior
No validation error.

Screenshots

Applicable Versions:

  • Netlify CMS version: [email protected]
  • Git provider: Gitlab self-hosted
  • OS: OSX
  • Browser version Version 81.0.4044.122 (Official Build) (64-bit)
@Undistraction Undistraction changed the title Validation Error When Using Only Local Media Directories Validation Error When Using Only Relative Media Directories Apr 27, 2020
@erezrokah
Copy link
Contributor

Hi @Undistraction, the global media_folder is required for collections that don't have media_folder specified and also since you can use templates to refer to refer to the global one, e.g. under a collection you can specify media_folder: {{media_folder}}/posts_images (this is not document yet though).

@Undistraction
Copy link
Contributor Author

@erezrokah Thanks for the explanation. That's a nice feature (being able to organise images within a central media directory).

I know that relative media directories are only a beta feature but would be great to add something to the docs highlighting that a global for is still required in the config even of you aren't using it.

@erezrokah
Copy link
Contributor

Good point @Undistraction, we've recently added the media folder templating and field based media folders. It is not even documented yet since we want to gradually gain confident with the current approach and get more use cases.
Closing this issue, as will open a new one to improve the docs.

@erezrokah
Copy link
Contributor

Opened https://github.com/netlify/netlify-cms/issues/3671, please share your thoughts there and let me know if I missed something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants