Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

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" />
share|improve this answer
    
Thanks. How do I create/edit these? –  LoneWolfPR Jan 29 '13 at 16:59
    
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/… –  ghangas Jan 29 '13 at 17:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.