Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Wrong path in css on server


Go to End


2 Posts   792 Views

Avatar
Harley

Community Member, 165 Posts

27 April 2013 at 2:37am

Hi there,

Ok I've never come across this before. I've just uploaded a website for a client who had their own hosting (always a nightmare!) with TsoHost. Everything looks to be fine except for image paths in my css according to Firebug. Background-images seem to be pointing to the assets folder instead of my theme folder. Paths for @font-face however seem to find the webfont files no problem strangely. In my css the background-images are relative to the root and display fine on my localhost.

Has anyone encountered this before and is there something I can set in the config to default my paths in css?

Any help is much appreciated.

Regards

Avatar
Harley

Community Member, 165 Posts

27 April 2013 at 2:49am

Edited: 27/04/2013 2:50am

PS I'm not sure if was worth mentioning but in my Page.php file I am concatenating my css and js files like so:

	// ******************** concatenate all javascript and css ******************** //
	
	$theme_folder = sprintf('themes/%s', SSViewer::current_theme());

		$js_files = array(
			sprintf('%s/js/jquery.1.9.1.min.js', $theme_folder),
			sprintf('%s/js/common.js', $theme_folder), 
		);

		$css_files = array(
				sprintf('%s/css/theme.css', $theme_folder),
			);
		foreach($js_files as $js) {
			Requirements::javascript($js);
		}

		foreach($css_files as $css) {
			Requirements::css($css);
		}

			Requirements::combine_files("js.js", $js_files);
			Requirements::combine_files("css.css", $css_files);
			Requirements::process_combined_files();	
	
	// ******************** end concatenation ******************** //

Thanks