Jump to:

23480 Posts in 18951 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » PLEASE HELP ME - CSS IMAGES

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

Page: 1
Go to End
Author Topic: 1596 Views
  • rodreading
    Avatar
    Community Member
    6 Posts

    PLEASE HELP ME - CSS IMAGES Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: PLEASE HELP ME - CSS IMAGES Link to this post

    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).

  • rodreading
    Avatar
    Community Member
    6 Posts

    Re: PLEASE HELP ME - CSS IMAGES Link to this post

    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!

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: PLEASE HELP ME - CSS IMAGES Link to this post

    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

    1596 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.