My college was working on a project that needed to create a custom Meeting Workspace site definition.
The simple answer would be to create a copy of the site definition and work from there
However as quite often SharePoint is not quite so simple.
The problem comes in the form of 3 web parts embedded in the MasterPage. These web parts check to see that the webTemplateId of the current SPWeb object is equal to 2 (which is the ID of the MPS templates In the webtemp.xml). These web parts then fail to render breaking the site.
He had located the problem but was unable to find a acceptable workaround.
1) He could modify the OotB MPS Site Definition (This is NOT acceptable practice)
2) He could use a feature stapler to modify the Site Definition on creation(This would apply to all new Meeting Workspace across the Farm and not really practical given the project)
3) he could remove the Web Parts and replace them with custom ones (the classic developer answer but never a practical one)
None of these option were really viable for his project.
So I asked him if he had thought of using a SPWebProvisioningProvider class.
With a little testing we found that the SPWebProvisioningProvider does not change the WebTemplateID as the Site Definition used during the provisioning of the site is still the OotB MPS Definition and the Provisioner runs code After the site had been created.
He can now create a Customised Meeting Workspace site definition.
the SPWebProvisioningProvider class he is using is quite small as all it does is activate and deactivate a few features, this allows for easy modification of the features rather than having to recompile the provisioner should the client wish to change anything.
Just something that popped up today :)
Draft - .NET Glossary Diagram
21 hours ago