spatie / statamic-responsive-images

Responsive images for Statamic 3
MIT License
99 stars 29 forks source link

Cast image string to array with src attribute #212

Closed stoffelio closed 1 year ago

stoffelio commented 1 year ago

This is a minor change to allow for easier migration from Statamic's built in asset fieldtype to the responsive fieldtype provided by this addon.

It allows us to simply change the type of an asset field (with limit 1) to responsive and automatically import the existing image as the default image in the responsive set, instead of having to go through and manually changing the data everywhere.

ncla commented 1 year ago

With this change, do you have to first re-save the entry for the responsive tag to work?

Just thinking about it: if you are manually changing the field type, why not also do a clever search and replace in your IDE/text editor?

stoffelio commented 1 year ago

You're right, I hadn't noticed that it only works after saving the entry again. So yeah, not a smooth enough solution to merge in. I'll just use it as a temporary patch for switching things one time.