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.

Customising the CMS /

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

The Required Stylesheets, SilverStripeNavigator Specifically


Go to End


3 Posts   1821 Views

Avatar
juneallison

Community Member, 110 Posts

16 July 2011 at 12:17am

Hi,

So I understand that there are a few required stylesheets that get inserted at the bottom of the header. I understand the importance of these. Once you login into the admin the SilverStripeNavigator stylesheet is also added to this group.

Is it possible for this stylesheet to be added to beginning of the head area as opposed to the end? It is overriding some of my other style sheets. Keeping the website styles in tact is more important to me than the styles of the navigator.

I know my other options are to 1) remove the navigator all together 2) examine the CSS and resolve any conflicts.

Any input would be great.

Thanks!

Avatar
Sam

Administrator, 690 Posts

5 August 2011 at 10:18am

The stylesheets are included in the order that they are requested, and duplicate inclusions are ignored, so one way of doing this is to force the navigator stylesheet to be included before anything else. Page_Controller::init() would work.

Put this into your Page_Controller::init():

if(Director::isDev() || Permission::check('CMS_ACCESS_CMSMain') || Permission::check('VIEW_DRAFT_CONTENT')) {
    Requirements::css(SAPPHIRE_DIR . '/css/SilverStripeNavigator.css');
}

Avatar
Sam

Administrator, 690 Posts

5 August 2011 at 10:20am

I find it a little surprising that the navigator CSS conflicts with your CSS, though, because all of its rules start with #SilverStripeNavigator, #SilverStripeNavigatorMessage, or #SilverStripeNavigatorLinkPopup.

We've tried to make SilverStripeNavigator.css "safe", and if it's not, we should probably fix that.

What is the nature of the conflict?