RSS

Minimal.Master missing corev4.css

09 Apr
Applies To: SharePoint 2010

While testing our new master page that replaces the minimal.master I noticed that depending on your permission level, things were rendering differently. If you had full permissions then things looked great, but if you were a visitor with read-only permissions things were a little off.

Taking a look at the actual page source we found that the stylesheet links in the header section looked different. With Full permissions the link to corev4.css existed, but didn’t for anyone else. Obviously permission to the corev4.css file wasn’t the issue since this was working fine on all other sites regardless of user permissions.

Some quick searching and experimentation revealed that the corev4.css link was only added to the page when the Site Actions menu was set to render. For the standard minimal.master file this is fine, but if you are depending on any of the corev4.css styles, you’ve got a problem. Fortunately, the solution is simple.

In your custom minimal.master master page find this section in the head element:

 <SharePoint:CssLink runat="server" Alternate="true"/>
 <SharePoint:Theme runat="server"/>
 <SharePoint:CssRegistration Name="minimalv4.css" runat="server"/>
 <SharePoint:CssRegistration Name="layouts.css" runat="server"/>

And add a CssRegistration element to corev4.css above the minimalv4.css CssRegistration:

 <SharePoint:CssLink runat="server" Alternate="true"/>
 <SharePoint:Theme runat="server"/>
 <SharePoint:CssRegistration Name="corev4.css" runat="server"/>
 <SharePoint:CssRegistration Name="minimalv4.css" runat="server"/>
 <SharePoint:CssRegistration Name="layouts.css" runat="server"/>

That’ll do it. The corev4.css will load regardless of the presence of the Site Actions menu and there aren’t any conflicts since SharePoint ensures it isn’t registered twice.

About these ads
 
6 Comments

Posted by on April 9, 2012 in Branding, SharePoint

 

Tags: , , , , ,

6 Responses to Minimal.Master missing corev4.css

  1. Sangram

    July 12, 2012 at 2:19 am

    How to render Site Action menu ?

     
  2. Sangram

    July 12, 2012 at 7:42 am

    Hi Chris,

    I am owner of my own site. I get missing corev4.css in v4.master as well as missing corev4.css in minimal.master I dont want to add those manually..How could I get it auto in my v4.master

     
  3. Adeboye

    August 20, 2012 at 5:53 am

    Hi, thanks for sharing the post, but can I just say that this soluition is not correct because it doesn’t solve the problem described.

     
    • theChrisKent

      August 20, 2012 at 9:01 am

      I’m sorry things aren’t working for you. The posted solution worked perfectly for me, but perhaps something is unclear. Could you provide any more details as to what you’ve tried? Thanks!

       
  4. Adeboye

    August 21, 2012 at 5:10 am

    Adding the CssRegistration for corev4.css before minimalv4.css exists, and the page still renders differently for users with read permission levels. the only other addition to that is that I added the global navigation link to the page to enable navigation in an out of search centre, and I dont see how that should affect the solution.

     
  5. SharePoint Plate (@SharePointPlate)

    January 25, 2013 at 2:49 am

    You saved an intranet launch today that would have looked really bad otherwise. Thanks!

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: