I wanted to ask if in TYPO3 LTS 11 is a way to change how TYPO3 generates the name for a rendered image?
In the template I use the f:image Viewhelper with cropVariant option to generates the image (done by TYPO3 Image Rendering).
<f:image image="{file}" cropVariant="desktop" />
That Image then has a name something like this: csm_my-image_88ade60319.jpg
Can I define how TYPO3 should name those rendered images?
For example to "my-image_large.jpg"
The
cms_
part of the filename is hardcoded in theTYPO3\CMS\Core\Resource\Processing\ImageCropScaleMaskTask::getTargetFileName
function. The hash at the end is added in theTYPO3\CMS\Core\Resource\Processing\AbstractGraphicalTask::getTargetFileName
function. Not sure whycms_
is added, but the hash is to make sure the file name is unique. The hash is generated using the file and configuration.So by default it isn't possible. If you really want different file names you can XCLASS
TYPO3\CMS\Core\Resource\Processing\ImageCropScaleMaskTask
with something like:You'll probably also want to add something to configure what the file name should be. So you'd probably also need to XCLASS the
TYPO3\CMS\Fluid\ViewHelpers\ImageViewHelper
class or create a new ViewHelper to add some settings to the processing instructions.Just make sure the file name is unique or you might get weird results.