Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

i would like to prevent corev4.css from loading for a public site (100% anonymous) to reduce pages size. any suggestions please ?

share|improve this question
    
Why do you want to prevent corev4.css when that's the CORE css? What are you trying to accomplish by reducing page size? –  Mike Jan 14 '13 at 19:57
2  
@Mike corev4.css is used for backoffice in my case i use a personalized css, soo i dont need the CORE css –  Mahmoud Jan 15 '13 at 10:45
add comment

4 Answers 4

Why can't you create a custom master page and remove the < SharePoint:CssLink runat="server" Version="4"/> from the markup?

SharePoint will then not add the css file to the request and you will get a much "lighter" page. But then every out of the box control's css will have to be re-entered from your branding project in any case you are using the out of the box controls.

If you are making a public facing site the I assume that you have a custom master page and custom page layouts anyways and you are not in need of all the css that's inside of SharePoint?

share|improve this answer
add comment

You need to make a custom control which inherits CssLink, and in that you need to make some logic which prevents the COREV4.css to be loaded based on some condition.

public partial class CustomCssLink : CssLink
{
    protected override void OnPreRender(EventArgs e)
    {
        // Logic here
    }
}
share|improve this answer
add comment

I don't think it's 'impossible', because there is the

<SharePoint:CssLink runat="server" Version="4"/> 

control in the master page which you can conditionally replace with other kinds of references to stylesheets you need on your publishing site.

share|improve this answer
    
can you explain more please –  Mahmoud Jan 30 '13 at 15:15
    
add comment

There is no way to accomplish this in a way that suits your goal. SharePoint will always add its CSS to each page. You could remove it client-side, but that doesn't solve your issue of reducing page size.

For public-facing sites, I have used Aptimizer (now owned by Riverbed): http://www.riverbed.com/us/products/stingray/stingray_aptimizer.php

Tools like Aptimizer compress, consolidate, etc., everything at the IIS level. Might be worth a shot.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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