2

I put a CssRegistration tag in my v4.master master page in SP 2010. I expected that subsites would inherit, but newly created subsites do not inherit from this master page. How can I force them to inherit from my newly created master page?

Second, I finally figured out (I think - haven't tested yet) that SharePoint Server Publishing Feature being activated lets you set the Alternate CSS. I was getting annoyed that I could not find it anywhere. Please confirm.

1 Answer 1

3

Correct, only when you have Publishing features enabled the following happens:

  1. Master page defined on the parent site can be inherited by subsites
  2. Alternate CSS configured on the parent site can be inherited by subsites

If you need to inherit the two and you have Team sites (non-publishing sites) I recommend writing simple event handler that sets the master page and CSS stylesheet of a subsite after it has been created (WebProvisioned). Example here.

Please note that you will not probably be able to inherit the parent's master/CSS, but you are setting those to be the same as the parent site has at that time. This means that when you change the master/CSS of the parent this change will not be reflected automatically to the subsites.

Workaround is to modify the actual master/CSS and not change it to some other file OR re-activate the feature that loops through all subsites and resets the master/CSS to be the same as parent site.

2
  • Thanks for the confirmation. I don't know why this is not mentioned in any of the numerous articles I read about using CSS with master pages. Hopefully Googlers out there will see this first.
    – Kyle
    Feb 6, 2012 at 16:34
  • Also, I marked it as answered.
    – Kyle
    Mar 1, 2012 at 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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