Page 1 of 1

Localhost css images path.

Posted: Thu Dec 01, 2011 1:58 pm
by vjandrei
Hi, i work in mamp local and my css files images do not show up.
The are like this.

Code: Select all

.sides {
	background-image: url(images/bg.gif);
	background-repeat: repeat-x;
	background-color: #fff;
}
And the path in safari looks like this
http://localhost:8888/easyholiday/tmp/c ... ges/bg.gif

why it takes tmp/cache/ ??

Code: Select all

root_url		 http://localhost:8888/easyholiday
ssl_url		 https://localhost:8888/easyholiday
root_path		 /Applications/MAMP/htdocs/easyholiday	(0755)
previews_path		 /Applications/MAMP/htdocs/easyholiday/tmp/cache	(0755)
uploads_path		 /Applications/MAMP/htdocs/easyholiday/uploads	(0755)
uploads_url		 http://localhost:8888/easyholiday/uploads
image_uploads_path		 /Applications/MAMP/htdocs/easyholiday/uploads/images	(0755)
image_uploads_url		 http://localhost:8888/easyholiday/uploads/images
ssl_uploads_url		 https://localhost:8888/easyholiday/uploads
Cms versio is 1.10.2

Re: Localhost css images path.

Posted: Thu Dec 01, 2011 3:14 pm
by Wishbone
The stylesheets are in /tmp/cache. Image paths are always relative to the stylesheet. Instead do:

Code: Select all

.sides {
   background-image: url([[root_url]]/images/bg.gif);
   background-repeat: repeat-x;
   background-color: #fff;
}
This is in the help for {cms_stylesheet}