Using Theme Changer when creating a custom site?

Mar 23, 2007 at 7:22 PM
Hi Scot,

I am trying to use the theme changer when i create a new site using my own site def. I'm not sure i'm doing it right though. I know the Theme Stapler can apply a theme when a standard STS site is created, but i need to do it for a custom.

Here's what i've done so far.

1. Copied the STS Site Def to MySite. (I have everything else in the custom site def working for the most part. Only a bug in Master Page settings are stopping me right now, but that's another story).
2. In my custom ONET.XML in the Configuration ID=0 block, i added to <SiteFeatures> the following.
<!-- Theme Changer -->
<Feature ID="B8DED45F-E2D9-4a5f-BD7F-502B737BE901">
<Property Key="Theme" Value="MyTheme"/>

When i create my custom site, the theme is not applied. I looked at the settings using Sharepoint Inspector and the Theme setting is blank.

Did i do something wrong?


Mar 26, 2007 at 6:55 PM
Little more information. I have been able to apply the theme by setting the theme settings in the feature itself, but not using the ONET.XML settings for some reason.

I tried creating my own feature to set the SiteLogoUrl value on creation. I used the code from the Worker class of ThemeChanger. I set the SiteLogoUrl value equal to a value passed in and save the site settings. I found that when i call it from the feature section of my config (like above) it does not take in the new value. Only if i change the value in the feature.xml of the feature itself and do an installfeature -force does it take the new value. (Verified all this in VS2005 debugger). Any idea why it's not taking the parameters?


Apr 4, 2007 at 11:42 AM
I think the issue is simply that the site does not exist yet when the ONET file is accessed. After the site exists, the feature is called and it works fine. I really designed it to be set in the Feature.xml file.