The MSDN documentation of the STSADM operation suggests that it cannot use site templates that are uploaded to the site’s site template gallery: Specifies the type of template to be used by the newly created site. If you do not specify a template to use, the owner can choose a template when he or she first browses to the site. The value must be in the form name#configuration. If you do not specify the configuration, (for example, STS) configuration 0 is the default (for example, STS#0). The list of available templates can be customized to include templates you create. To display a list of custom templates, use the Enumtemplates operation. Valid values available in a default installation include: STS#0: Team Site STS#1: Blank Site STS#2: Document Workspace MPS#0: Basic Meeting Workspace MPS#1: Blank Meeting Workspace MPS#2: Decision Meeting Workspace MPS#3: Social Meeting Workspace MPS#4: Multipage Meeting Workspace BLOG#0: Blog WIKI#0: Wiki Site The sitetemplate parameter however can contain the name of a custom site template that is not in the central template gallery but in the site collection’s site template gallery. Stsadm -o createweb -url '-title 'Title' -sitetemplate 'MyTemplate.stp' So don’t let yourself be mislead by the documentation. After writing my a lot of people have asked me whether you can use web templates to create site collections. The short answer is ‘yes, you can’. ![]() A big plus of this approach is, that when at some point you want to migrate your site to SharePoint vNext you don't have to rebuild your custom site definition for vNext. The site looks like it was created based on a standard site definition and modified using the UI afterwards. This means it should be easier to. I was using Sharepoint 2003 and now just got into MOSS. Basically, I have a task where we create a site. Say for eg: Department and then add some inbuilt webparts and some custom web parts. Now I want to use this site as template site for 10 other departments. In SP 2003, I saved the site as template. Mar 28, 2017 Custom list templates do not appear on the 'Create Page. When you create a custom list template in a site and. Template in a Windows SharePoint. ![]() This post will walk through the steps of how to actually do that. In this post I will build a very basic web template, the point of the post is how to use web templates to create site collections. If you want more in-depth information on how to create a web template take a look. To create a web template we start by opening up Visual Studio. We will create an “Empty SharePoint Project”. I will call mine “MyTemplate” but you can obviously give it any name you like. I create site templates all the time, based on look, feel and lists that I've defined. But today, I wanted to move a SharePoint site (that didn't have much content, note that Site Templates are recommended to be under 10MB to add as 'new sites') and have that site and content as the 'root' or '/' of. We will start of by deploying the solution as a sandboxed solution. Make sure the URL you choose to deploy the solution to actually points to an existing SharePoint site on the machine you are working on. RIght-click on the project name in the solution explorer and select Add > New Item. Choose to add an Empty Element and give it a nice name. I will call mine “MyCoolWebTemplate”. I would advise you to choose a name that doesn’t contain any spaces. Visual Studio will automatically add an Elements.xml file to your empty element. In here we can define the metadata of our web template. For those of you who have built site definitions in the past, this file will replace the webtemp*.xml file that a site definition uses. In order to allow us to use an elements file to specify a web template a new XML element was introduced with SharePoint 2010, the WebTemplate element. The WebTemplate element can contain a lot of attributes, but we don’t need all of them. A site created using a web template will only use that web template while the site is being provisioned. After that the site will think it is based on the site definition and configuration listed in the BaseTemplateID, BaseTemplateName and BaseConfigurationID. These attributes have to be filled in for the web template to work properly. You should base your web template on an out of the box site definition that is as close to the web template you’ll be creating as possible. In my case I have chosen to use the standard Team Site site definition. This site definition won’t actually be used when the site is being provisioned, but it is what the site’s SPWeb.WebTemplate, SPWeb.WebTemplateID and SPWeb.Configuration will return if queried after the site has been created. I know this is confusing, but it’s important to wrap your head around it, in order to understand how web templates work. A big plus of this approach is, that when at some point you want to migrate your site to SharePoint vNext you don’t have to rebuild your custom site definition for vNext.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
April 2018
Categories |