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');
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
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');
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.
I am not adding it. Silverstripe adds it by default!
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.
Regardless of how they get there, is there a way to block them only on the front end?
Put the Requirements::block() call in the init() method of your Page_Controller.