Jump to content

[Solved] Enabling Smart cache CCC removes background image


Recommended Posts

When I enable Smart cache CCC for CSS, the background image of my theme is replaced by giant question marks.

 

Please see images attached showing before and after enabling CCC.

 

I am using Prestashop 1.5.4.1 with the default theme. I added the background image url on line 111 of theme/css/global.css as follows:

 

body{

 

font:normal 11px/14px Arial, Verdana, sans-serif;

 

color:#222;

 

background:#fff url('/img/gifs/header-bg.gif') repeat-x;

 

}

 

 

Is this function just not working or is there another way of adding a background that will compress properly?

 

Thanks for any ideas

post-27482-0-62674700-1375070999_thumb.jpg

post-27482-0-37560000-1375071011_thumb.jpg

Edited by duratex (see edit history)
Link to comment
Share on other sites

Just try not to use url starting with / in your css files, cause that's what mess up with ccc enabled. Just to be clear, let's say you have to use in your style.css image1.jpg and image2.jpg located as follows:

\css
  style.css
  \img
	    image1.jpg
\img
  image2.jpg

 

Correct url should be 'img/image1.jpg' and '../img/image2.jpg'

Link to comment
Share on other sites

  • 4 months later...

Change background url. Should be: background: #fff url('../img/gifs/header-bg.gif') repeat-x;

For that configuration header-bg.gif file should be placed in /themes/<your_theme>/img/gifs/

 

 

Sorry to post in a old topic, but I just wanted to check something, in regards to a header image I notice the URL is different.

I have a module which adds a search box to every page at the top, and I want the background colour to be an image instead, however using ../img etc or img/ etc both appear with a broken image..

 

The location of the css file would be this;

/themes/zappies/css/modules

and the image is here;

 

/themes/zappies/img

 

 

How would I put the image in the CSS without it breaking?

Link to comment
Share on other sites

  • 2 weeks later...

If it's css for module than it can't be in /themes/zappies/css/modules as this won't override .css file from /modules/your_module/

Instead it should be placed in /themes/zappies/css/modules/your_module/

Now to show image from /themes/zappies/img/ you should use background: url(../../../img/your_image.png) but easier way is to place image in the same location as your .css file and use background: url(your_image.png)

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...