Netlify-cms: Cloudinary per field configuration doesn't work

Created on 11 Jan 2019  路  13Comments  路  Source: netlify/netlify-cms

Hi!

Describe the bug
I'm using Cloudinary as my media library. I want to set output_filename_only: false for all fields globally and enable it on specific fields but it only works globally.

With the config below I always get the full url.

Expected behavior
I would expect to define a global value for how the output of files should look like and change it on specific fields. At least thats how I understand the documentation.

The Cloudinary media library integration can be configured in two ways: globally and per field
https://www.netlifycms.org/docs/cloudinary/#cloudinary-configuration-options

In my example I'd expect a full url in the body field and only the file name in the image field

Applicable Versions:

  • Netlify CMS version: netlify-cms 2.3.3
  • Git provider:GitHub
  • OS: macOS High Sierra
  • Browser version Firefox Nightlx

CMS configuration

media_library:
  name: cloudinary
  output_filename_only: false
  config:
    cloud_name: my_name
    api_key: 1234567890

collections:
  - name: 'til' 
    label: 'TIL' 
    folder: 'til' 
    create: true
    slug: '{{slug}}' 
    fields:
      - { label: 'Body', name: 'body', widget: 'markdown', required: false }
      - { label: 'Image', name: 'image', widget: 'image', required: false, media_library: { output_filename_only: true }  }

Thank you!

extensionmedia-libraries good first issue bug

Most helpful comment

I'm using neflify CMS version 2.9.7 and I'm having problems setting output_file_name globally. Saves the whole url instead of just the filename. Thanks!

All 13 comments

Having the same issue. Setting output_file_name to true globally doesn't help either.

I believe this has been addressed, in one of a handful of Cloudinary PR's back in January - March. Please comment if you're still experiencing this and we'll re-open.

I'm using neflify CMS version 2.9.7 and I'm having problems setting output_file_name globally. Saves the whole url instead of just the filename. Thanks!

@erquhart I still have the issue, output_filename_only: true to image field or any custom transformation for image field doesnt work at all.

Has anyone found a solution to this problem?

Re-opening as it looks like the original issue still exists

Looks like this was never supported (I think the docs are a bit confusing about that) as the options used by insertHandler here:
https://github.com/netlify/netlify-cms/blob/b151bdfd7311472eaa1861e9fc17546a3658a083/packages/netlify-cms-media-library-cloudinary/src/index.js#L62 are only taken from the top level config.
We should probably update them per field configuration similar to allowMultiple here:
https://github.com/netlify/netlify-cms/blob/b151bdfd7311472eaa1861e9fc17546a3658a083/packages/netlify-cms-media-library-cloudinary/src/index.js#L69

So this feature is not really supported?

Not unsupported, just needs someone to dig in and work out a fix (the good first issue label will hopefully get more eyes on it).

Note for anyone attempting a fix: a few different things are being called out here - for example, an earlier comment stated that setting output_filename_only is not working globally, which isn't a per-field configuration problem. Might be a general bug with the arguments passed to insertHandler().

Is this really not higher on the list? It kinda makes cloudinary useless... I would fix it my self, but i lack the js chops.

Can someone let me know what we should do, this is really a bummer. Cloudinary is currently used just to store images. I'm not able to use any transformations because of this issue.

If someone would like to submit a PR for this it would be great.
See my comment https://github.com/netlify/netlify-cms/issues/2001#issuecomment-617073054 for hints

Might want to fix the documentation in the meantime. I've apparently chased my tail on a feature that doesn't exist.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Narno picture Narno  路  3Comments

ghost picture ghost  路  3Comments

dur41d picture dur41d  路  3Comments

marcojakob picture marcojakob  路  3Comments

kalwalt picture kalwalt  路  3Comments