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 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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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. –  KyleM Feb 6 '12 at 16:34
    
Also, I marked it as answered. –  KyleM Mar 1 '12 at 0:09

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.