Haven't been able to get this to work...

Mar 19, 2007 at 7:37 PM
I want to apply a theme (Lacquer) whenever a new site is created.

I followed the instructions in the ReadMe file.

But I don't think I'm doing the stapling right.

I changed the feature.xml file in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\ThemeChanger to:

<?xml version="1.0" encoding="utf-8" ?>
<Feature Title="Theme Changer"
Description="Changes the site theme and alternate CSS as specified in the FEATURE.XML file."
ReceiverAssembly="ThemeChanger, Version=, Culture=neutral,PublicKeyToken=f0f1662b9aa4205c"
<Property Key="Theme" Value="Lacquer"/>
<Property Key="AlternateCss" Value=""/>
<ElementManifest Location="ThemeChanger.xml"/>

Then I created the ThemeChanger.xml file in the same folder with:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<FeatureSiteTemplateAssociation Id="B8DED45F-E2D9-4a5f-BD7F-502B737BE901" TemplateName="GLOBAL" />

(I tried STS#0 and other values instead of "GLOBAL" and they didn't work either.)

Then I tried creating a new site with the Team Site template and it used the default theme still.

What am I doing wrong? I see that the feature is activated, it just doesn't seem to do anything.
Mar 21, 2007 at 1:43 AM
You need to either staple this feature to a site or include the feature in a site definition. I think what we need is a feature that staples this one to a team site as an example. I'll work on that.

Mar 21, 2007 at 2:49 AM
Release 2.0 is now posted and contains a staple for the Theme Changer
Mar 21, 2007 at 4:09 PM

Thanks, I'll check it out. I didn't realize it until now, but I have your book right here on my desk!
Mar 21, 2007 at 4:52 PM

That works on my development system. I'm still battling another issue where MOSS will not use my customized default.master automatically. When I create a new site, it uses the out-of-box default.master and when I look at the master page in Stie Settings, it always says "The site master page setting currently applied to this site is invalid".

I can then change the master page to my default.master and it works fine, but it just will not use it automatically. And it does the same thing on two different MOSS servers here.

So while your ThemeChanger is 50% of the solution, using a custom default.master is the other 50% and I just can't get that to work. Have you ever seen that type of error? Or is it not supposed to work as I am expecting? I thought you could modify and publish changes to default.master and all new sites created would use that default.master.
Apr 4, 2007 at 11:45 AM
This behavior is expected. I know others have used this approach to ensure that the master page was set on creation as well. Perhaps I'll do an update that will allow the master page to be set. Also, someone mentioned setting the logo as well.
Apr 4, 2007 at 2:12 PM
Really? What's the point of a master page or the "Inherit from parent" option if it can't automatically be used?

I also tried modifying your source to set the master page along with the theme, but it didn't work - I could have done it wrong though.