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?
[solved] caching css ressources: 404 error
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: caching css ressources: 404 error
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.
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.
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.
Re: caching css ressources: 404 error
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.
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.