It seems I've been incorrectly using WebTemplateId where I should be using the Configuration property.
//web is an SPWeb instance
var templateName = web.WebTemplate + "#" + web.Configuration;
Using this code gives me the correct templateName I can use to create new webs.
Web template refers to new feature element available in SharePoint
2010, which provides us flexible way to define definition (onet.xml
file), which will be used only on provisioning time, when the site is
created. There are no references to the definition on runtime, which
provide easy maintainability for the definition.
The accepted answer is not correct. You can create multiple root sites in one web application. Additionally, each root site does not have to have a url of www.domain.com/path/site1. Using Host Named Site Collections, each root site can have it's own sub domain name. If your company name is contoso, and you create a web application at webapp.contoso.com, You ...
If your final goal is migration to SharePoint Online (SPOL) you definately need to think this into your branding approach.
WebTemplates were our choice for SharePoint 2010 on-premises solutions, since they have a much better upgrade story than custom site definitions. We have also long ago dropped the declarative approach for other artifacts and for ...
Go to your Web Template File inside …/TEMPLATE/LCID/XML
There is an attribute SubWebOnly in the Configuration element of the template. Set that attribute to TRUE and the template should show only when creating subsites.
<Template Name=" " ID="">
Your webtemplate is probably not globally deployed
[..]the documentation for Get-SPWebTemplate which
states “Displays all globally installed site templates that match the
given identity.” A sandboxed solution is not globally deployed, which
explains why the template couldn’t be found. Source
$web = get-spweb http://intranet
$template = $...
Why dont you just add the feature to SiteFeatures or WebFeatures element of onet.xml ? It is what it is there for :)
The features are executed synchronous, so only in very rare occasions have I experienced race conditions.
This happens because your DCWebTemplate is a module.
You can't use a module to deploy to farm. If you check your spi-file you can see the attribute SupportedDeploymentScopes is only web and site.
<ProjectItem Type="Microsoft.VisualStudio.SharePoint.Module" SupportedTrustLevels="All" SupportedDeploymentScopes="Web, Site" xmlns="http://schemas.microsoft....
When you create a site using a Web Template there is no dependency from that site to the Web Template that created it, that's one of the major differences between Site Templates and Web Templates.
BUT the Web Template may use custom features which then create a dependency between the Site and the solution(s) containing these features. These dependencies may ...
Gets the name of the site definition or site template that was used to create the site.
static void Main(string args)
using (SPSite site = new SPSite("http://localhost"))
using (SPWeb web = site....
I had a similar problem. After I created my Web Application I received a strange error, But my Web Application was created, so I continued creating a Site Collection on it but received "403 forbidden" in the end.
These instructions helped me:
After I raised the timeout parameters in the IIS I recreated the WebApp ...
You can have three different site collections based on three different templates. It doesn't matter if they are based on custom templates or not.
In a web application you can create
750,000 (500,000 Personal Sites and 250,000 other sites per farm)
The maximum recommended number of site collections per farm is 500,000
Personal Sites plus 250,...
What you could do, is to use for example jQuery. There are elements lower down in the structure that has unique (well unique for all List View Webparts) classes.
That code adds the class tada-listview-webpart to the most outer element of a List View Webpart.
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
<label class="ms-hidden"><SharePoint:ProjectProperty Property="Title" runat="server"/></label>
This is a snippet from default.aspx in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\...
Represents a collection of sites in a Web application, including a top-level website and all its subsites.
Represents a SharePoint website.
Contains a customized site design based on an existing site definition. Site templates in this context exist outside of any site definition.
Real World Example
The marketing team ...
In you custom ONET.XML you need to provision default.aspx as well.
<Module Name="Home" Url="$Resources:osrvcore,List_Pages_UrlName;" Path="">
<File Url="default.aspx" Type="GhostableInLibrary" >
<Property Name="Title" Value="$Resources:cmscore,IPPT_HomeWelcomePage_Title;" />
That's correct, the STS#1, or Blank site template, is not available in SharePoint Online, but that's not what you want anyway. You can't apply a template to a site that already has a template.
What you want to do is use the "select template later" option. In the UI, click the "Custom" tab and "Select Template Later".
Then once the site is created you can ...
The onet.xml file is divided into two parts, first is the "SiteFeatures" and the second called "WebFeatures". The "SiteFeatures" Section that holds the site features starts activating all the features only when creating a site collection.
The "WebFeatures" Section that holds the web features starts activating all the web scoped features only when creating a ...
yes, You can have a site definition with more then 1 configuration, and you can use one of them to create a site,
for example, when we try to create a site we give web template name its configuration ID,
Let say you got a site definition with two configuration, 1 and 0,
STS#0 Team Site
STS#1 Blank Site
You can create a Team site by using ...
You will need to add MasterUrl attribute to your configuration node and also need to add module element for master page,
Your configuration will look like this,
<Configuration ID=”0” Name=”Default” MasterUrl=”_catalogs/masterpage/project.master“>
and module node will be something like this,
<Module Name=”MasterPage” List=”116” Url=”_catalogs/...
In one web application, can we create multiple root site collections ?
No, only one 'root' can exist, if you mean at the root of the URL i.e. http://domain.com/. You can create many more at http://domain.com/path/site1, http://domain.com/path/site2, etc. I just wanted to clarify the use of the word 'root'
You are using the rootweb of the site, not the current web, so any changing you are making is always to the rootweb. Instead of using webTemp to get rootweb, just use webTemp as the web.
private const string QuicklaunchHeader = "Saksmappe";
public override void FeatureActivated(SPFeatureReceiverProperties properties)
SPWeb web = properties.Feature....
I think that you should not to add web part to the page directly, instead of it you should use web part provision. You can start your research from this posts:
Provisioning Custom WebPart in SharePoint 2010 tricks
Provision a WebPart using a SharePoint Feature
Provision publishing page with webpart in sandboxed solution
The error says that you are missing the template 10099 with LCID 1033. So you might have the templates installed, but SharePoint can't find the template that you have installed that has LCID 1033 (English US). Maybe you need to update the XML to be set to LCID 1033.
I solved the problem so I am leaving here the solution that worked for me. In the onet.xml file there is line
I have replaced it with the following one
<NavBar Name="SharePoint Top Navbar" ID="1002"></NavBar>
Now its working.
I've looked into this same requirement. We went down the road of creating a site collection and selecting it later. The PowerShell options, http://technet.microsoft.com/en-us/library/fp161370.aspx, for creating a site collection should provide the same. I don't see an option to upload a template and create the site at the same time.
You can't deploy site templates (onet.xml files) to the Office 365, so you are stuck with the templates that they offer you for site-collection creation. Webs on the other hand you can create your own web templates and use.
One interesting concept that might help you out are remote site provisioning, where an external provisioning provider is responsible ...