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.

General Questions

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

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

PLEASE HELP ME - CSS IMAGES


Reply

4 Posts   1619 Views

Avatar
rodreading

15 July 2009 at 7:51am (Last edited: 15 July 2009 8:43am), Community Member, 6 Posts

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

15 July 2009 at 9:00am Forum Moderator, 5511 Posts

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

15 July 2009 at 2:27pm Community Member, 6 Posts

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

15 July 2009 at 2:47pm (Last edited: 15 July 2009 2:48pm), Forum Moderator, 5511 Posts

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