How to change the default theme of the new sites that are creating
Hi Is there a way to apply a Site Theme to the whole site collection and the new (sub) sites that are created later? thanks in advance. Ratheesh CS
April 28th, 2010 9:50am

You can apply a theme to a site. Almost certainly not to the entire site collection except by changing the master page. (and then it will apply only to sites in the site collection that have not been edited in such a way that they will no longer continue to have master page changes apply to them) You can also apply a theme to a site and then save the site as template. Then all future sites created by using that template will have the theme already applied. FAQ sites: (SP 2010) http://wssv4faq.mindsharp.com; (v3) http://wssv3faq.mindsharp.com and (WSS 2.0) http://wssv2faq.mindsharp.com Complete Book Lists (incl. foreign language) on each site.
Free Windows Admin Tool Kit Click here and download it now
April 28th, 2010 10:08am

To update existing sites with a theme PowerShell could be used: [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $url="http://mysitecollection"; $spsite=New-Object Microsoft.SharePoint.SPSite($url); $spsite.AllWebs | ForEach-Object { $_.ApplyTheme("MYTHEME"); $_.Update(); } $spsite.Dispose(); To ensure that the same theme is used on new sites, either a site template with the theme could be created and all new sites are then created using the site template or some code will need to be written to set the theme on site creation using feature stapling. Steps to set the theme using feature stapling can be found here: http://sptechpoint.wordpress.com/2009/12/22/apply-a-moss-wss-theme-via-feature-stapling/
April 28th, 2010 10:09am

Hi Rathees, Create a console application in C# with folowing code or create a feature and on featureactivated event write this code: SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite("[Sitecollectionurl]")) { using (SPWeb web = site.OpenWeb()) { ApplyTheme(SPWeb web); } } }); protected void ApplyTheme(SPWeb site) { site.ApplyTheme("[ThemeName]"); site.Update(); foreach(SPWeb childWeb in site.Webs) { ApplyTheme(childWeb); } } Regards,Manvir Singh Pamma
Free Windows Admin Tool Kit Click here and download it now
April 28th, 2010 1:14pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics