0

Is there a way to apply a different CSS file to system pages in a SharePoint 2010 site collection? We don't want to modify the master page and weren't sure if there's any other solution. Thanks.

Update: We're using a custom page layout for our publishing pages; within this, we have some CSS files that contain custom classes but also overwrite existing SP classes. We have not touched the master page so it's using the default one that came with SharePoint.

2
  • It depends on how your CSS is built. Does it overwrite existing standard SP css classes? Do you use a custom masterpage for non-system pages? Please provide us with more info on this.
    – user2536
    Dec 6, 2011 at 10:01
  • Hi, @Dandroid. Please see update above.
    – Alex C
    Dec 6, 2011 at 11:33

3 Answers 3

3

You could create a SharePoint DelegateControl as described here https://littletalk.wordpress.com/2010/11/18/create-an-additionalpagehead-control-packed-into-a-feature-in-visual-studio-2010/ and check in your code if it runs on a page which contain "/_layouts/" in the url and if so add a reference to your custom CSS file.

3

A solution is to create a custom masterpage, in which you register all CSS classes needed. This way, you'll be able to use the custom masterpage on your non-system pages and the v4.master (or whatever you're using) on your system pages without having to bug with alternating css.

I personally always go with this as it garuanties me full control.

1

You could use the alternate css link to brand your system pages, this can be done without any custom code

1
  • 2
    If I remember correctly an alternate CSS link applies to all pages, including system pages. So, I'm not sure how your solution would work out for the original poster of the question.
    – Sig Weber
    Dec 6, 2011 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.