1
votes

I have created a WebTemplate which I have successfully deployed to the farm and used. A request has been made to have the feature deployed to a Web Application and not the entire farm. Is this even possible? If so, could someone tell me what I might be doing wrong? The Feature that contains the WebTemplate was initially scoped to the farm. Changing the scope to WebApplication throws an error during installation stating "WebApplication scoped features cannot contain WebTemplates" (something to that affect). Setting the WebApplication when running Install-SPSolution continues to deploy it to farm .. same result whether I have the feature scoped to the farm or site.

Any ideas?

1

1 Answers

0
votes

WebTemplates can only be scoped at Farm or SiteCollection level.

Having a templates on a webapplication level is possible:

  • Create a site definition (not that different from your current webtemplate.
  • Create an empty web application scoped feature, set auto activate to false.
  • In the webtemp.*.xml file add a FeatureDependency to your template.

Now you template only shows up in webapplications where the specified feature is activated.