I'm working on a custom Blog site template that's quite similar to the OOTB Blog site template. I'm having issues with CSS registration of the OOTB blog.css
file. (i.e. via Microsoft.SharePoint.WebControls.CssRegistration
, with causes the CSS link to be generated by a <SharePoint:CssLink />
element.)
The OOTB template appears to be registering blog.css
, and causing a <link>
to be rendered, on several pages. I can see CssStyleSheet
properties on its View
elements in the Posts list's schema.xml
which I assume are the way it is registering the CSS.
My template (which was written by someone else and has been migrated from 2007 to 2010) appears to be registering blog.css
, and causing a <link>
to be rendered, only on the site's home page, but I can't figure out how. There are no CssStyleSheet
properties on its View
elements. (Indeed, there is no reference to blog.css
in the entire solution.) If I add these properties, nothing changes (after creating a new site from the template).
Edit: This is incorrect; I just didn't add the properties on enough View elements. I now know the correct way to register the CSS I want, in order to match the way the OOTB registers it. However, I'll leave this question here, as being able to hook into CssRegistration would still be useful.
Is there a way I can observe how and where CSS files are being registered, so I can compare my template to the OOTB template and get my CSS registered properly?
(I've tried using Reflector to decompile Microsoft.SharePoint.dll and set breakpoints on the relevant code, but a lot of the code was optimized out and I didn't get much insight.)