PowerShell, SharePoint, Technical

WebTemplate Presentation for CO SharePoint User Group

Many thanks to all who attended last nights Colorado SharePoint User Group meeting! I had a great time presenting on Web Templates (and Site Definitions and Site Templates Smile) and it was awesome catching up with friends and making some new friends as well.

My presentation is attached here, as well as a zip of one of the sample WebTemplate Visual Studio projects I demonstrated. The project includes most of what you would need for a team site and gives you a good start for creating your own custom WebTemplates. The project also includes the PowerShell pre & post deployment scripts for those that were interested.

Feel free to comment here if there’s something else you’re looking for but can’t find.

SharePoint 2010 Web Templates Overview COSPUG
CleanTeamSiteFromScratch

0 thoughts on “WebTemplate Presentation for CO SharePoint User Group

  1. I am wondering if you can further explain/validate my understanding of the attributes of BaseTemplateID and BaseTemplateName
    In Context:
    <WebTemplate
    BaseTemplateID="1"
    BaseTemplateName="STS"
    BaseConfigurationID="0"

    I believe the "base" site def that you refer to has no influence on your webtemplate. There is no pull down of any lists/libraries or navigation from the base site definition. I believe it is merely a 'dumb' reference to a site definition for run time purposes.

    For example, in my webtemplate onet.xml, it is pretty much bare, and I end up getting a purely blank site with lists and left navigation.

    Your comments in validating my finding.

    Roy

    1. Hi Roy –

      You’re pretty much spot on. The BaseTemplate is used as a dumb reference from the perspective of creating a new web template in that your web template doesn’t actually use any of the functionality defined in that template. However, once a site is created with your web template, there is a small dependency. Although the site is created with all the functionality you define in the web template and none of the functionality from the base template, if you look at the SPWeb.WebTemplateId property of the site you will see that it uses the ID from the base template. SharePoint has to do this because of the plumbing it has related to dependencies on files existing in the 14 directory. Web templates don’t deploy physical files, so this is what they came up with.

      Hope that helps.

      Ryan

Leave a Reply

Your email address will not be published. Required fields are marked *