Should version_urls be working inside the image srcset attribute? #2841
Unanswered
brainspin-max
asked this question in
Q&A
Replies: 1 comment
-
This seems to be a bug / missing feature. The problem can be fixed by changing the public function url(): string
{
$conversionName = '';
if ($this->generatedFor() !== 'media_library_original') {
$conversionName = $this->generatedFor();
}
$urlGenerator = UrlGeneratorFactory::createForMedia($this->media, $conversionName);
$url = $urlGenerator->getResponsiveImagesDirectoryUrl() . rawurlencode($this->fileName);
if (Config::get('media-library.version_urls') === true && $urlGenerator instanceof BaseUrlGenerator) {
$url = $urlGenerator->versionUrl($url);
}
return $url;
} But i think that it would be better to add the version inside the DefaultUrlGenerator.php, but i didnt got it to work by now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
At the moment the plugin only seems to append a version to the src attribute, the urls inside the srcset seem to miss the version parameter. Is this a bug / feature request or is there something i do wrong?
Beta Was this translation helpful? Give feedback.
All reactions