I've edited the v4.master in the 'my/' site collection to load a custom css file for styling. The problem is, when a user creates their own personal site it loads the default color scheme. I assume that means each new site gets a copy of the default v4.master and not my edited version. Is there an easy way to make is so that, by default, all new personal sites load my custom css?
1 Answer
Delegate controls can do that for you.
Elements.xml:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Control
Id="AdditionalPageHead"
Sequence="1000"
ControlSrc="~/_controltemplates/MySites.Branding/MySitesCss.ascx">
</Control>
</Elements>
MySitesCss.ascx:
<!-- Header omitted for brevity/clarity -->
<!-- Add custom css registration -->
<SharePoint:CssRegistration ID="CssRegistration1" Name="/_layouts/1033/styles/MySites.css" runat="server" After="minimalv4.css" />
-
-
The most common way is to use MS Visual Studio. There are several tutorials on how to create a feature to use delegate controls. Here is one that gets you within striking distance of the above code: weblogs.asp.net/sreejukg/archive/2011/10/27/…– ghangasCommented Jan 29, 2013 at 17:09