I ran into this one when trying to customize a SharePoint 2010 form using the “Customize Form” button to add some custom colors on an InfoPath form for a SharePoint list. If you perform a visual upgrade in SharePoint 2010 everything works fine. However, if you do not do the visual upgrade, the page does not respect your color theme and reverts to the default “blue” theme.
By pressing F12 in Internet Explorer, you can see what is going on:
Notice how the core.css file is written out correctly and then overridden by the Obsidian color theme correctly.
However, what is happening is that Infopath is adding another reference to core.css after the Obsidian color theme.
Lines 7 and 8 of the “View Source” html show the correct order of CSS references with Obsidian after core.css
However, InfoPath adds the following reference to core.css which overrides the Obsidian theme on line 30.
Solution:
Open the Editifs.aspx page in SharePoint Designer 2010 in advanced mode (right click).
Copy the reference to your color theme into the page (in my case I put it in line 226 in the asp content area.) If you don’t know it, view the source of a correct colored page and copy the reference to the stylesheet. Then, open your Editifs.aspx page in SP Designer 2010 and find the last line in the asp content area before the “PlaceHolderMain” area.
</SharePoint:UIVersionedContent>
<link rel=”stylesheet” type=”text/css” id=”onetidThemeCSS” href=”/Legal/_themes/Plastic/Plas1011-65001.css?rev=14%2E0%2E6123%2E5000″/>
</asp:Content>
<asp:Content ContentPlaceHolderId=”PlaceHolderMain” runat=”server”>
Add your reference to the style sheet:
<link rel=”stylesheet” type=”text/css” id=”onetidThemeCSS” href=”/Legal/_themes/Plastic/Plas1011-65001.css?rev=14%2E0%2E6123%2E5000″/>
Save the file and you are done.
thank you so much! I was looking for this! ir works like a charm!!