Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » Change order of applied CSS.

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1773 Views
  • MKayHavoc
    Community Member
    33 Posts

    Change order of applied CSS. Link to this post


    How can I change the order of my css files?

    at the minute it's:

    <!--[if IE 6]>
       <style type="text/css">
        @import url(themes/staff/css/ie6.css);
    <!--[if IE 7]>
       <style type="text/css">
       @import url(themes/staff/css/ie7.css);
    <link rel="stylesheet" type="text/css" href="themes/staff/css/layout.css" />
    <link rel="stylesheet" type="text/css" href="themes/staff/css/typography.css" />
    <link rel="stylesheet" type="text/css" href="themes/staff/css/form.css" />

    When it should be:


    I can't see were to change it in the templates.

  • KingBerT
    Community Member
    11 Posts

    Re: Change order of applied CSS. Link to this post

    look into your code folder!
    Then open Page.php
    There you'll find smth like:

    class Page_Controller extends ContentController {
       function init() {

    Here you can change the order, or remove those commands and write it direct to the head element.

  • Willr
    Forum Moderator
    5508 Posts

    Re: Change order of applied CSS. Link to this post

    As KingBert pointed out some on the CSS files are loaded dynamically from the PHP where as the IE conditional comment files are loading from the template. Requirements() the method you call to add css files automagically inserts the links at the end of the <head> section. Someone in the forum has come up with a script to include ie stylessheets from the PHP - see http://www.silverstripe.com/site-builders-forum/flat/58061#post60072

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.