#86310Fallback logic for image viewhelpers
Description
To simplify the management of crop variants a fallback logic for image viewhelpers could be implemented.
Let’s suppose we have 4 variants (bootstrap_package case): default, medium, small, extrasmall.
If the editor crops only the ‘default’ variant there’s no way to make this crop to be used in every case (breakpoints). In this case the FE will crop the image in large resolutions (‘default’ variant) but not in smaller resolutions (medium, small, extrasmall).
So the editor is forced to crop and maintain all the 4 variants if (s)he wants that the default crop is valid for every breakpoint.
This is inconvenient.
There should be an option to set the fallback like:
’cropVariantsFallback’ => ‘extrasmall,small,medium,default’
so when TYPO3 renders the ‘extrasmall’ variant, it checks if there’s a crop, if not it checks ‘small’, if not ‘medium’ and finally, if also ‘medium’ is not cropped, it crops as ‘default’ is cropped. If also ‘default’ is not cropped then it renders the image without crop.
Or simply there could be a switch like:
’cropVariantsFallback’ => true
and TYPO3 checks the crop variants sorted by declaration order.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[FEATURE] Fallback logic for image viewhelpers Resolves: #86310 Releases: main