Jump to content

Absolute images paths and CSS compression


Recommended Posts

Hi there,

 

For a online catalog, I modified and customized the default Prestashop theme in order to make it looks like the main website. Because the catalog is on a sub-domain, unlike the main website, I used the full path for the main layout images, in order to avoid having duplicates and avoid our visitors to load twice the exact same images twice when they are coming from the main website and vice versa.

 

However, there is a problem when CCC is enabled for CSS. Every url() properties are modified so it adds the full path to the theme images folder (which I think is a bit stupid; if ones care about minifying and compressing the CSS files, it makes no sense using longer image URLs than those in the original, uncompressed CSS, which uses relative paths...)

 

 

So, in the case layout images being linked to the main website, the online store URL is added before. In the end, I get broken links, something that looks like this:

background-image:url(http://shop.example.com/themes/prestashop/css/http://www.example.com/images/image.png);

 

 

So as for now, I need to disable CSS compression, even thought everything else is compressed, which is kind of disappointing.

 

So, is there any way to prevent Prestashop from adding the full paths in the images? Or otherwise, any way to fix my issue without duplicating all my layout images?

 

Thanks in advance!

  • Like 1
Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...

Just updated from 1.4.7 to 1.5.3 and was disapointed to see that the issue is still present... :huh: I'm looking for a way to edit the PHP files so it will keep the relative path (again, that is very retarded, why using longer URLs in a minified CSS file?). I don't really know where to look tough..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...