Search
Other CDN for Joomla! questions
Forum

images inside srcset are not converted anymore

Louis Jansen's Avatar Louis Jansen
Hi there,

On some pages I use the <picture><source srcset> elements to show the right image size to the right viewport. The image urls inside were converted before into the urls pointing to the my CDN.

1. Currently that is not the case anymore
2. Instead I still see the relative path in the source of the page. However, whenever I point to that relative url in a browser using "inspect element" is see a combination of the page url + image url is loaded for some weird reason
relative image url: /general-image-folder/specific-image-folder/some-image.jpg
page url the image is on: https://mydomain/level-1-category/level-2-category/sef-page-title

urls I see on image hover: https://mydomain/level-1-category/level-2-category//general-image-folder/specific-image-folder/some-image.jpg

To make it very explicit, that image is not existing on that last mentioned url. I am pretty sure that I did something wrong and it's not the plugin itself. But I can't figure out what happened. Images that are loaded with a regular <img> element are converted fine.

I did play around with the plugin order but that did not have any impact. Any tips, hints, solutions to solve this?

Kind regards,

Louis
Peter van Westen's Avatar Peter van Westen ADMIN
What do the urls look like when CDN for Joomla! is not active (switch of plugin)?
Are they still wrong?
If so, then it indeed has nothing to do with CDN for Joomla!
Please post a rating at the Joomla! Extensions Directory
Louis Jansen's Avatar Louis Jansen
If CDN for Joomla is turned off, everything is 100% fine. The urls are fine and all images are visible.
Peter van Westen's Avatar Peter van Westen ADMIN
Can you give me (super) admin and (s)ftp access so I can take a look?
And tell me on what url I can see/reproduce the issue.
You can use the 'Hidden text' button in the forum editor to hide the confidential information.
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
First, Please try the latest development version from:
www.regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Louis Jansen's Avatar Louis Jansen
Peter van Westen wrote:
First, Please try the latest development version from:
www.regularlabs.com/development-releases

Hi Peter,

Thanks for that version. However, on my dev environment I can reproduce the exact similar behaviour. Might that have to do with production on https and dev on http? Futhermore if my dev environment is on a subdomain is it licensed to use the pro-plugin as well?

The development release of the plugin does not change the behaviour on the production environment.

Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
You can or cannot reproduce it?

Regarding using it on subdomains or other websites. See: regularlabs.com/faqs#pre-sale-questions-...-on-multiple-domains
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
And yes http vs https can have to do with it. If you have set up CDN for Joomla to convert the media urls to https, on a http domain, then the images won't work.
You can't mix http and https.
See your browser's console log for more information on this.
Please post a rating at the Joomla! Extensions Directory
Louis Jansen's Avatar Louis Jansen
Fortunately I was finally able to reproduce the issue on my dev environment.

Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
So where exactly can I see the issue? What images are not loading? Of which images is the path not correct after enabling CDN for Joomla?
Please post a rating at the Joomla! Extensions Directory
Louis Jansen's Avatar Louis Jansen
Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
Changes I make to any of the files do not seem to have an effect on the website. Do the ftp details give access to the correct folder?
Or is there some form of extra caching going on?
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
Ok, think I found the issue anyway.
Please try the latest development version from:
www.regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Louis Jansen's Avatar Louis Jansen
🙂 yes that works! 🙂

always curious to know what it caused since it worked before. But many thanks anyway Peter!

Kind regards,

Louis
Peter van Westen's Avatar Peter van Westen ADMIN
A simple stupid typo in this case.

The code was creating a new value with all the correct replacements for the srcset value.
But then replacing the srcset value for the output with the original value instead of the new value.
So essentially nothing got replaced in the srcset.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription