I'm trying to customize the landing page of a teamsite. The WikiPageHomePage feature sets the SitePages/Home.aspx as the default landing page. What I want to do is to deploy a new file to this library and add some webparts to the page. The file is deployed by a module in a web scoped feature. This feature is stapled to the teamsite definition. In the feature activated event I'm trying to add a webpart to this file. When the newly created web is a rootweb I can't get to the page yet in the feature activated event, because the file isn't there yet. So I'm running into the site provisioning order issue. Also described here: http://sharepointmagazine.net/articles/introduction-to-sharepoint-feature-stapling-part-2
Feature stapling doesn't seem to be the right approach in this case. Unfortunately I'm not allowed to create a site definition or a web template.
What are my options?
Thanks for the suggestion about CPP. I created a new webtemp file with a custom template name and setup a CPP:
<Template Name="TestProvision" ID="100000">
<Configuration ID="0" Title="Test provision" Hidden="FALSE"
ImageUrl="/_layouts/images/CPVW.gif" Description="Test provision"
DisplayCategory="Test Provision"
ProvisionAssembly="ProvisioningProvider, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=1e7bee723732232c"
ProvisionClass="ProvisioningProvider.CustomProvisioningProvider"
ProvisionData="">
</Configuration>
</Template>
public class CustomProvisioningProvider : SPWebProvisioningProvider
{
public override void Provision(SPWebProvisioningProperties props)
{
SPWeb web = props.Web;
web.ApplyWebTemplate("STS#0");
web.Lists.Add("Test list", " Description 123", SPListTemplateType.GenericList);
web.Update();
}
}
This template shows up at the template selection when creating a site collection and the code in the CPP is processed. So far so good.
When I change the custom template name in the new webtemp file to STS, I would like SharePoint to process the code in the CPP when creating a site collection based on a team site, but it doesn't.
<Template Name="STS" ID="100000">
<Configuration ID="0" Title="Test provision" Hidden="FALSE"
ImageUrl="/_layouts/images/CPVW.gif" Description="Test provision"
DisplayCategory="Test Provision"
ProvisionAssembly="ProvisioningProvider, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=1e7bee723732232c"
ProvisionClass="ProvisioningProvider.CustomProvisioningProvider"
ProvisionData="">
</Configuration>
</Template>
Is this possible at all or am I on the wrong track?