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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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

PLEASE HELP ME - CSS IMAGES


Go to End


4 Posts   3072 Views

Avatar
rodreading

Community Member, 6 Posts

15 July 2009 at 7:51am

Edited: 15/07/2009 8:43am

For some reason when I refresh that pages. Or do a /dev/build on my site. The css background images are disappearing.
The layout seems to be fine, it is just the background images that are linked in my css file, one minute they are there
and then I refresh or dev/build and they are gone.

I REALLY REALLY NEED TO FIX THIS PROBLEM. Please help me.
I thought that it was a problem with my browser, but for some reason I do not know how to get it back?
Has anyone else had trouble with this?

here is the link to the site:

http://www.mustangandclassics.com

Avatar
Willr

Forum Moderator, 5523 Posts

15 July 2009 at 9:00am

Using Firebugs Net panel you can see any 404ing requests. It looks like you are going 1 level to high. The path for the images is themes/images/navbg.jpg I am guessing it should be themes/mustangclassic/images/navbg.jpg. In your CSS this should be url(../images/... rather then url(../../images).

Avatar
rodreading

Community Member, 6 Posts

15 July 2009 at 2:27pm

The problem with the template is that I was directly linking to the css files in my template

Like This:
<link rel="stylesheet" type="text/css" href="mustangclassic/css/layout.css" />
<link rel="stylesheet" type="text/css" href="mustangclassic/css/typography.css" />
<link rel="stylesheet" type="text/css" href="mustangclassic/css/form.css" />

My CSS files were doubling up whenever it would process the page.
SilverStripe was choosing the first available layout when it would load.

I deleted the direct link to the css above and replaced it with this:

<% require themedCSS(layout) %>
<% require themedCSS(typography) %>
<% require themedCSS(form) %>

Of course the only way that this works in this instance is if your css files are named exactly as above
Example
layout.css
typograhy.css
form.css

Thank you very much for your help!

Avatar
Willr

Forum Moderator, 5523 Posts

15 July 2009 at 2:47pm

Edited: 15/07/2009 2:48pm

It was including it twice as you probably had a Requirements() call in your page.php file which loaded those files automatically. See mysite/code/Page.php for the existing requirements