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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

why does silverstripe load the css for the modules first?


Go to End


3 Posts   7227 Views

Avatar
hm2k

Community Member, 7 Posts

16 April 2008 at 8:25am

Edited: 16/04/2008 11:05am

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.

Avatar
Willr

Forum Moderator, 5523 Posts

16 April 2008 at 3:59pm

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

Avatar
hm2k

Community Member, 7 Posts

16 April 2008 at 10:39pm

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?