17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1404 Views |
-
Themes in stable 2.1: where is my css?

16 October 2007 at 11:55pm Last edited: 17 October 2007 12:25am
In the stable version of 2.1 I'm not getting my stylesheets to work.
In rc1 all I had to do was setting SSViewer::set_theme('mytheme');
but that doesn't seem to do much anymore... I'm not seeeing any styles attached.It worked with the default black candy theme, then I changed ssviewer:set_theme in the _config.php file.
Ideas?
-
Re: Themes in stable 2.1: where is my css?

20 October 2007 at 4:02am
I am having the exact same issue as dio5.
-
Re: Themes in stable 2.1: where is my css?

20 October 2007 at 4:07am
I solved this by manually setting the stylesheet links in the Page.ss file.
Don't know if that's the recommended way though...
-
Re: Themes in stable 2.1: where is my css?

20 October 2007 at 4:47am Last edited: 20 October 2007 4:47am
Which one of the several page.ss?
I was trying to check out the paddygreen-theme just for fun and in the end just renamed it to the default theme. Result was a broken layout.
But nevermind, since I'm not to enthusiastic about SilverStripe after all it's not really worth the effort.Thanks anyway.
-
Re: Themes in stable 2.1: where is my css?

22 October 2007 at 9:48pm Last edited: 22 October 2007 9:48pm
In PaddyGreen we will have to check this out but for your CSS files you should have this in your Page.php (in mysite/code)
function init() {
parent::init();
Requirements::themedCSS('layout');
Requirements::themedCSS('typography');
Requirements::themedCSS('form');
Requirements::themedCSS('myuberfancycssfile');
}
Requirements loads CSS files based on what theme you have set. So in your _config.php you will have SSViewer::set_theme('PaddyGreen') and having that init() in your php will automagiclly look for the css files in PaddyGreen/css. Or you can edit the main Page.ss (If using PaddyGreen it will be themes/PaddyGreen/templates/Page.ss) and add the CSS files as per any standard CSS Linking method
. Why we have requirements for the css is something I dont even know! I personally prefer the second method.. I just like to have full control over them in my templates.
| 1404 Views | ||
|
Page:
1
|
Go to Top |



