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.

Customising the CMS

The Required Stylesheets, SilverStripeNavigator Specifically


Reply

3 Posts   729 Views

Avatar
juneallison

16 July 2011 at 12:17am Community Member, 108 Posts

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

5 August 2011 at 10:18am Administrator, 685 Posts

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

5 August 2011 at 10:20am Administrator, 685 Posts

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?