thomasvantuycom / craft-cloudinary

Cloudinary integration for Craft CMS
MIT License
5 stars 2 forks source link

Assets preview in the CMS is not working #5

Closed valboivin closed 7 months ago

valboivin commented 7 months ago

The asset delivery URL for my images is not the same on the deployed website versus in the CMS panel (i.e. for previews).

It seems like the URL generated for my images in the website is based on the Base URL I've entered in the config, which is good! Images on the live websites work just fine.

However, the URL generated to preview images in the CMS or in the Assets pages of the admin is wrong. It points out to the default delivery URL for Cloudinary (https://res.cloudinary.com/...). It's not using the mentioned base URL from the settings in my filesystems. Since our account has its own private CDN distribution configurations, I think that the asset delivery URL should use our base url instead to work.

As seen on Cloudinary documentation:

screenshot 2023-12-06 at 4 45 35 PM

thomasvantuycom commented 7 months ago

Hi Valerie,

I've added support for custom CNAMEs in version 1.4.0. I am confident that the transformation URLs should now be accurate; however, please let me know if you come across any discrepancies.

valboivin commented 7 months ago

@thomasvantuycom thank you so much for this quick enhancement! 👍 😄

I still have one minor problem with the generated URL for the transformation to work.

In our Cloudinary setup, we do use the fixed folders structure. We have base folders for every environments we are using. I know there's a way for the Upload API to specify a folder name in the upload options, but I don't see any for the transformation.

Could I suggest some more enhancements to the plugin to support base folder? I've modified the code on my side to make it work. Here's what I suggest:

Let me know what you think!

valboivin commented 7 months ago

I'm suggesting a Pull Request for the support of the base folder. (#6) Feel free to review it. Thank you!

thomasvantuycom commented 7 months ago

I've moved the second request to its own issue.