why css image linking adds tmp/cache?

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
JiiPee
Forum Members
Forum Members
Posts: 81
Joined: Fri Jan 23, 2009 7:03 pm

why css image linking adds tmp/cache?

Post by JiiPee »

I am building a new site and I am using cmsms mle 1.8.2 full.
When I try to add images in css, like:

Code: Select all

#header {
    background: url(uploads/images/header.jpg) no-repeat center top; 
    width: 940px;
    height: 220px;
}
Image dont show and when I click to see image path, it gives http://www.mydomain.com/web/tmp/cache/u ... header.jpg. I am curently building the site inside the web folder, so no problem there but where does it take that tmp/cache to the address?

Edit: All the images attached from page editor to the content are showing ok, so this only happens when I try to link images from css file.
Last edited by JiiPee on Mon Sep 27, 2010 9:48 am, edited 1 time in total.
uniqu3

Re: why css image linking adds tmp/cache?

Post by uniqu3 »

use:
background: url([[root_url]]/uploads/images/header.jpg) no-repeat center top;
or
background: url(../../uploads/images/header.jpg) no-repeat center top;
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: why css image linking adds tmp/cache?

Post by Dr.CSS »

Actually I find you don't need (../../  just (/uploads  ...
uniqu3

Re: why css image linking adds tmp/cache?

Post by uniqu3 »

Didn'T know about that ond Dr.CSS or i actually never tried it since i tend to use root_url or even subdomain.
JiiPee
Forum Members
Forum Members
Posts: 81
Joined: Fri Jan 23, 2009 7:03 pm

Re: why css image linking adds tmp/cache?

Post by JiiPee »

It seems that because I am building it in the web/ sub folder, it needs to be /web/uploads to work.
I just thought that before I didnt needed to modify any links after I transfer site from sub folder to root.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: why css image linking adds tmp/cache?

Post by RonnyK »

This depends, on using {stylesheet} or {cms_stylesheet}.

As {cms_stylesheet} is cached, it works from that folder. This requires that [[root_url]] is placed in front of relative paths.

When you use {stylesheet}, then the paths are relative and not cached. The the uploads/ should work.

I guess that you use {cms_stylesheet} in the page-template, and with that [[root_url]] is required.

Ronny

P.S. This board is for official CORE, NOT for the MLE-fork.... Please move this topic to the MLE-board.
Locked

Return to “[locked] Installation, Setup and Upgrade”