Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » why does silverstripe load the css for the modules first?

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: 6568 Views
  • hm2k
    Avatar
    Community Member
    7 Posts

    why does silverstripe load the css for the modules first? Link to this post

    The way it is at the moment means that when you load a module, if you want your style from your ecommerce module to adjust the layout when invoked, it won't work, because it's loaded first.

    For web developers, this is just plain dumb.

    It'd make more sense for it to load the core css (layout.css, etc) first, then load the the various modules that may want to change the original layout styles AFTER.

    A good example of this is when you might only want a sidebar on your modules, not on all your pages.

    Thus, I could disable it by default, then simple enable it when the module is invoked.

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: why does silverstripe load the css for the modules first? Link to this post

    The CSS For the modules is loaded in order yourtheme_module/css/NameOfFile.css and if thats not there then it uses the modules default file. There was a bug in the forum module which meant this wasn't the case but it should work for ecommerce - if you want to change the css all you should need to do is create a css file with the same name in a yourtheme_ecommerce/css/ folder and it should include your own before the module

  • hm2k
    Avatar
    Community Member
    7 Posts

    Re: why does silverstripe load the css for the modules first? Link to this post

    No, you don't understand, look...

    Visit: http://demo.silverstripe.com/ecommerce/ and checkout the HTML...

    <link rel="stylesheet" type="text/css" href="ecommerce/css/ProductGroup.css" />
    <link rel="stylesheet" type="text/css" href="ecommerce/css/Cart.css" />
    <link rel="stylesheet" type="text/css" href="themes/blackcandy/css/layout.css" />
    <link rel="stylesheet" type="text/css" href="themes/blackcandy/css/typography.css" />
    <link rel="stylesheet" type="text/css" href="themes/blackcandy/css/form.css" />

    As you can see, the ecommerce module css is loaded first, when in fact, it should be loaded AFTER the core layout css files... IE:

    <link rel="stylesheet" type="text/css" href="themes/blackcandy/css/layout.css" />
    <link rel="stylesheet" type="text/css" href="themes/blackcandy/css/typography.css" />
    <link rel="stylesheet" type="text/css" href="themes/blackcandy/css/form.css" />
    <link rel="stylesheet" type="text/css" href="ecommerce/css/ProductGroup.css" />
    <link rel="stylesheet" type="text/css" href="ecommerce/css/Cart.css" />

    Do you understand?

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