Jump to:

22977 Posts in 11742 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Don't load Typo and Form CSS

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 2
Go to End
Author Topic: 1749 Views
  • suntrop
    Avatar
    Community Member
    131 Posts

    Don't load Typo and Form CSS Link to this post

    Hi all. I set up my template and copied the blackcandy folder to get started.
    There were these three lines of code in the header:

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

    Since I only want to load one CSS file, I deleted the last two lines. But SS renders the code …

    <link rel="stylesheet" type="text/css" href="http://cms.example.com/themes/co/css/layout.css?m=1270378560" />
    <link rel="stylesheet" type="text/css" href="http://cms.example.com/themes/co/css/typography.css?m=1270376329" />
    <link rel="stylesheet" type="text/css" href="http://cms.example.com/themes/co/css/form.css?m=1270376321" />

    How do I get rid of the form and typography stylesheet? And by the way – what are these digits after each file?

    Thanks!

  • baba-papa
    Avatar
    Community Member
    279 Posts

    Re: Don't load Typo and Form CSS Link to this post

    The CSS files are included in your Page_Controller as well. Have a look at the init().

  • suntrop
    Avatar
    Community Member
    131 Posts

    Re: Don't load Typo and Form CSS Link to this post

    Thanks, found them. I removed the lines from init() and wrote in my template to load just the layout css.
    I am wondering why SS puts the code always at the end of the <header> element. Even I put it in my template above other meta tags.

  • suntrop
    Avatar
    Community Member
    131 Posts

    Re: Don't load Typo and Form CSS Link to this post

    Does anybody can help about my CSS file?

    I need to have it above my header inline styles otherwise I can't overwrite styles from that file.

    Thanks!
    suntrop

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Don't load Typo and Form CSS Link to this post

    You can't easily customize the order. I suggest you use a more specific selector in your file which would override it no matter what order its included in.

  • Double-A-Ron
    Avatar
    Community Member
    599 Posts

    Re: Don't load Typo and Form CSS Link to this post

    Will's suggestion is the best, but if it's too difficult to refactor your CSS, the only thing I can think of is to remove the SS specific inclusions and hard code the <link> tags in the template where-ever you want them to appear.

    You do lose SS's cool versioning/cache system however.

  • suntrop
    Avatar
    Community Member
    131 Posts

    Re: Don't load Typo and Form CSS Link to this post

    >> You can't easily customize the order.
    It's a pity. That does make things more complicated (as stated above) and isn't quite like the other flexible "you-have-the-control" thing of SS.

    >>You do lose SS's cool versioning/cache system however.
    What's that? The strange numbers at the end of the CSS file?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Don't load Typo and Form CSS Link to this post

    It's a pity. That does make things more complicated (as stated above) and isn't quite like the other flexible "you-have-the-control" thing of SS.

    Can you think of a nicer way to provide the order? Perhaps an array which defines the order.... Sometimes providing a massive set of configuration options throughout the core is more trouble than using the other workarounds. After using SS for quite a while I've don't think I have ever needed to configure the order of the requirements.

    1749 Views
Page: 1 2
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.