Hi
I have created a custom version of the built-in "Get Started With Your Site" WebPart. The tile view WebPart that gets added to a "Team Site's home wiki page. This WebPart is working well.
Now what I would like to do is replace the built-in WebPart on the wiki page with my custom one.
My Initial Approach
1. Create Custom "Get Started With Your Site" WebPart
2. Create a feture to add the WebPart and modify the html in the wiki pages SPItem.WikiField to replace the built in WebPart with my custom one.
3. Create a feature stapler to Associate the feature at step 2 with the STS#0 site template (Team Site)
The problem is that the feature stapler runs too early in the process and the wiki page is not present yet to be modified. Activating the feature manually in the UI after the site has been provisioned works but not during.
To get around this problem I have tried the following;
Start A New Thread and Poll SPWeb.Provisioned
I have tried the System.Threading.ThreadPool.QueueUserWorkItemMethod where you poll the SPWeb until SPWeb.Provisioned = True and then make the changes to the wiki home page. This works ok but because of the delay the user must refresh the page after the site has been provisioned and rendered to the browser. (The user will still see the built-in WebPart until they refresh the page).
Copy STS Site Definition Adding My Web Feature Last
I have tried Copying the STS template changing the name and modifying the onet.xml with my web feature last in the list. Still could not get it to work. Even putting activation dependencies in my feature had no effect.
Questions
1. Is there a way to replace the built-in "Get Started With Your Site" WebPart in the Team Sites Wiki Home Page with a custom one during the provisioning phase.
2. Is there a way to Mimic and replace the WikiPageHomePage Feature in my custom site definition with a custom one? I have tried creating an instance of this feature reciever in another custom feature receiver class and calling its methods. (Could not Inherit) It did not work.
3. Is there a way to control the order that web features are activated in the onet.xml file or are they activated asynchronously?
Thanks