[solved] caching css ressources: 404 error

For problem reports, and discussions about the CMSMS 2.2 beta.

This board will be locked once CMSMS 2.2 is officially released.
Locked
User avatar
Franck
Dev Team Member
Dev Team Member
Posts: 248
Joined: Tue Jun 12, 2007 1:29 pm
Location: France

[solved] caching css ressources: 404 error

Post by Franck »

When editing and saving a css file in assets/css, all its linked ressources (img, fonts…) are being added tmp/cache/ to their paths, leading to 404 errors.
Am I doing something wrong or is it a bug?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: caching css ressources: 404 error

Post by calguy1000 »

CSS files are stored in assets/css OR in the database but the {cms_styleseet} call generates a file in tmp/cache and that's what the HTML stylesheet tag uses. This part has not changed in CMSMS 2.2.

Therefore, if using relative paths in the CSS they would be relative to tmp/cache.

Best is to use absolute paths. [[root_url]]/assets/images/foo.jpg etc. or to use paths relative to the root. i.e: /assets/images/foo.jpg (whatever works)... but [[root_url]]/assets/images/foo.jpg is recommended as it will definately remove any relative path issues.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Franck
Dev Team Member
Dev Team Member
Posts: 248
Joined: Tue Jun 12, 2007 1:29 pm
Location: France

Re: caching css ressources: 404 error

Post by Franck »

Oh yes, should have remembered this one. Actually, as I was using sass without {cms_stylesheet} for the last sites, I didn't have to use [[root_url]] in stylesheets anymore.
Now, I'm using sass with {cms_stylesheet} and the url parameter is a bit more complicated to find. Btw, I found it.

Thanks for the reply.
Locked

Return to “[locked] CMSMS 2.2 Beta”