Apply master page for all subsites in SharePoint 2010
-
2011年12月1日 4:26
Hi All,
Working on a SP2010 Standard intranet/extranet project.I have created a master page to use for all sites.
But i would like to apply the masterpages to all sites and subsites.
So what i'm trying to achieve is when i create a new site i want it t use this master page as default.
Any ideas?
Is this possible without enabling the SharePoint Server Publishing InfrastructureThanks in Advance
すべての返信
-
2011年12月1日 5:12
You dont want to activate the Publishing feature !! in that case you should open the site in designer -->Open masterPage-->Set your new master page as "Default Master Page". Hope that solves your problem :)
-
2011年12月1日 6:24
Thanks for the reply.
Does that mean when i create a new site collection or a new subsite will it use the one i set as Default Master Page.Anyway i did try it but its greyed out.
Cheers
-
2011年12月1日 6:32
No, that never works. You can't set the Master Page in one Site Collection to another site collection.
If you want to use the one Master Page for all sites and subsites with in a Site Collection without Publishing feature, you have to write code to achive this.
But for newly created site, you have to go SharePoint Designer or write code to set Master Page.
Regards,
Shantha Kumar .T | MCPD - SharePoint Developer 2010 | MCITP - SharePoint Administrator 2010
(B) Shantha Kumar's Blog | (T)Follow me -
2011年12月1日 6:36
A master page is available for a specific site collection only, so master page from site collection A cannot be available in site collection B.
So for each new site collection, you need have master-page specific to that site collection.
For the subsite, yes it will be applied to all the sites that inherit from it.
Thanks, Kunal Govani -
2011年12月1日 6:42
Hi Patric,
For this you can use feature stapling, You can write a feature in farm level and another feature that will ghost your masterpage and then set it as a default masterpage in feature activated code.
There are template code for each type of site template in Sharepoint. You can associate the farm feature to the desired template.
So whenever the site will be created using that template your feature will get activated and the farm level feature will activate the site level feature and the job is done.
reference
http://blogs.msdn.com/b/kunal_mukherjee/archive/2011/01/11/feature-stapling-in-sharepoint-2010.aspx
http://sharepointchick.com/archive/2010/03/26/deploying-a-custom-master-page-in-sharepoint-2010.aspx
http://www.sharepointnutsandbolts.com/2007/05/feature-stapling.html
mark as answer if you find worth
Thanks and regards
Arun Sahu
- 編集済み Arun Sahu 2011年12月1日 6:43
- 回答の候補に設定 Arun Sahu 2011年12月1日 9:55
- 回答の候補の設定解除 Steven AndrewsEditor 2012年4月16日 11:31
-
2011年12月1日 9:18
I you would like to control the master page for all new sites and sitecollections you should look into this solution:
http://jebass.blogspot.com/2008/11/using-centrally-managable-custom.html
Stefan Goßner
Senior Escalation Engineer - Microsoft CSS
This post is provided "AS IS" with no warrenties and confers no rights. -
2011年12月1日 9:32
Thanks for the reply.
Does that mean when i create a new site collection or a new subsite will it use the one i set as Default Master Page.Anyway i did try it but its greyed out.
Cheers
No it doesnot work .You have to manually set it.You cant use the MaterPage of sitcollection1 to set in sitecolletion2 as well.In case u want to set the custom masterpage on site creation .You got the do it through code.Add a feature to change the master page on site creation. -
2011年12月1日 9:49
Hi Patrick,
1.Deploy master page to site collection you want to create - use module in VS 2010 SP project, add it to feature scoped to Site. - http://sharepointchick.com/archive/2010/03/26/deploying-a-custom-master-page-in-sharepoint-2010.aspx
2.Activate this feature on site collection you create which will make sure its available.
3.Create a feature receiver which changes the master page of site. Activate this feature on any web you create. http://consultingblogs.emc.com/mattlally/archive/2011/09/30/master-page-feature-receiver.aspx
These feature can easily activated from UI or you can staple those to a site definition you want to use. http://www.olavaukan.com/tag/feature-stapling/
Hope this helps
Regards
Yogesh
-
2011年12月7日 5:41Thanks guys.
So to my understanding adding a feature would be the ANSWER.
But one more thing though If i have only one sitecollection and have one customised master page.When i create a new subsite will it inherit from the parent?
-
2011年12月7日 6:32No you cannot inherit when you create new sitecollection if you done through "Feature". Publishing Feature is the best way if you want custom or tailored pages to be inherited on your sitecollections.
Think More..Do More.. -
2011年12月7日 6:47
Murugesa I'm suing a custom menu and when i enable publishing fearture it breaks my menu by adding another menu.
Also i mean creating a new subsite under a new site collection.Not a new site collection.Cheers
-
2011年12月15日 2:01
Thanks for the links
I did follow this artcile: http://sharepointchick.com/archive/2010/03/26/deploying-a-custom-master-page-in-sharepoint-2010.aspxBut when i deploy my solution and activate the feature on a site collection and then create a subsite in that site collection the master page doesn't show up for the subsite.
Do i need to activate the publishing infrastrcuture feature for this to work?
I have a custom master page and all i want to do is use it for all site collection and subsites of the site collection.(So the subsite should inherit from Parent)
So when i create a new subsite under the site collectionit will inherit the master page.
-
2011年12月15日 5:41
You have to acivate the Publishing Infrastructure feature, then only the new site have access to parent master page and applied that to your newly created site.
If you didn't activate the feature, the new site will take the master page from the subsite only.
Regards,
Shantha Kumar .T | MCPD - SharePoint Developer 2010 | MCITP - SharePoint Administrator 2010
(B) Shantha Kumar's Blog | (T)Follow me -
2012年4月2日 6:40Deploy the master page then go to site action -> site settings then go to look and feel then master page -> from the 2nd option system master page select your master page for all its sites and sub site. if I am wrong let me know
Thanks Bijay | @Fewlines4Biju | LinkedIn | FaceBook | My Blog | SharePointDotNet.com | EnjoySharePoint.com
-
2012年4月3日 2:26
Hi Bijay,
Which sharepoint version are you talking about?
I can't see anything like System Master Page.
Is this SP 2010 which version?
Cheers
-
2012年4月16日 11:24
Dear Patrick
first you will take main site to save site as site template (after applying the custom master page )
then create sub sites based on that template.
Jithendar
- 回答の候補に設定 Jithendar Bathini 2012年4月18日 11:28

