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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Don't load Typo and Form CSS


Go to End


9 Posts   2776 Views

Avatar
suntrop

Community Member, 141 Posts

5 April 2010 at 1:38am

Edited: 05/04/2010 1:39am

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!

Avatar
baba-papa

Community Member, 279 Posts

5 April 2010 at 3:14am

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

Avatar
suntrop

Community Member, 141 Posts

5 April 2010 at 5:35am

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.

Avatar
suntrop

Community Member, 141 Posts

6 April 2010 at 12:13am

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

Avatar
Willr

Forum Moderator, 5523 Posts

6 April 2010 at 8:52am

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.

Avatar
Double-A-Ron

Community Member, 607 Posts

6 April 2010 at 12:50pm

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.

Avatar
suntrop

Community Member, 141 Posts

7 April 2010 at 2:45am

>> 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?

Avatar
Willr

Forum Moderator, 5523 Posts

7 April 2010 at 12:02pm

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.

Go to Top