decap-cms icon indicating copy to clipboard operation
decap-cms copied to clipboard

Cloudinary per field configuration doesn't work

Open matuzo opened this issue 7 years ago • 16 comments

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!

matuzo avatar Jan 11 '19 18:01 matuzo

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

JohnWelle avatar Jan 29 '19 17:01 JohnWelle

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.

erquhart avatar Jun 05 '19 15:06 erquhart

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!

danielkellyio avatar Dec 04 '19 03:12 danielkellyio

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

jerriclynsjohn avatar Mar 13 '20 10:03 jerriclynsjohn

Has anyone found a solution to this problem?

fmeyer1980 avatar Apr 20 '20 18:04 fmeyer1980

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

erezrokah avatar Apr 21 '20 08:04 erezrokah

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

erezrokah avatar Apr 21 '20 09:04 erezrokah

So this feature is not really supported?

IrvingArmenta avatar Jun 11 '20 05:06 IrvingArmenta

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().

erquhart avatar Jun 11 '20 12:06 erquhart

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.

Jursdotme avatar Sep 14 '20 18:09 Jursdotme

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.

jerriclynsjohn avatar Sep 16 '20 16:09 jerriclynsjohn

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

erezrokah avatar Sep 16 '20 16:09 erezrokah

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

jaarong avatar Oct 09 '20 19:10 jaarong

Please fix!

lightpositive avatar Mar 14 '22 00:03 lightpositive

Any idea for workaround?

joealmond avatar Mar 14 '22 00:03 joealmond

Hi all 👋 We'd be happy to accept a documentation PR to clarify this, or a fixed based on https://github.com/netlify/netlify-cms/issues/2001#issuecomment-693524374

erezrokah avatar Mar 14 '22 09:03 erezrokah