21288 Posts in 5733 Topics by 2602 members
General Questions
SilverStripe Forums » General Questions » Block CSS from all front-end pages but not from administrative pages
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 675 Views |
-
Block CSS from all front-end pages but not from administrative pages

8 August 2011 at 4:35am
How can I block CSS from all front-end pages but not from administrative pages?
If I put this line in the config file the the CSS gets blocked from all front-end AND administrative pages:
Requirements::block('cms/css/typography.css');
-
Re: Block CSS from all front-end pages but not from administrative pages

8 August 2011 at 7:18am
But you have full control of the frontend don't you?
Just remove the call to typography.css in the frontend part of your code,no need to block it. -
Re: Block CSS from all front-end pages but not from administrative pages

8 August 2011 at 7:52am
I am not adding it. Silverstripe adds it by default!
-
Re: Block CSS from all front-end pages but not from administrative pages

8 August 2011 at 7:57am
If you've done a basic install then there's three calls to Requirements::themedCSS() in the init() function of your Page_Controller but those are easily removed. If you've already removed those then something else is adding them, not Silverstripe.
-
Re: Block CSS from all front-end pages but not from administrative pages

8 August 2011 at 9:06am
Regardless of how they get there, is there a way to block them only on the front end?
-
Re: Block CSS from all front-end pages but not from administrative pages

8 August 2011 at 9:11am
Put the Requirements::block() call in the init() method of your Page_Controller.
| 675 Views | ||
|
Page:
1
|
Go to Top |


