I wish to define a Sharepoint site template that will also include a web part dependent feature. How can I install and activate the web part feature when I provision a site using my custom template?
+3
A:
You can't install a feature when provisioning a site you can only activate it
If your developing a Site Template then you can activate the feature by activating it inside the site you use to create your site template before you save it as a template.
But if this is something that's going to be reused I recommend that you develop a Site Definition instead and in here you can specify which feature to activate both at Site Collection and Site level. You can then package your feature and site definition into the same Solution package then the feature will always be installed when referenced by the Site definition
Per Jakobsen
2009-07-22 12:03:16