Minimal.Master missing corev4.css

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.

Advertisements

8 thoughts on “Minimal.Master missing corev4.css

  1. 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

  2. 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.

    • 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!

  3. 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.

  4. Note that in the Search Center the corev4.css does not render for anonymous accounts. It uses the minimal.master master page and therefore suffers from this same problem. Strange that it only does this for anonymous users however.

  5. This helped me create a custom master page for my enterprise search center (must use minimal.master as the template). We use a custom XML sitemap. The minimalv4.css was not rendering for anyone besides admins, causing the full sitemap to display in the headers during testing. This tip fixed my problem. 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 )

Google+ photo

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

Connecting to %s