Answered by:
Create a Site template with subsites in Sharepoint Server 2010

Question
-
Hi, I'm with my first SharePoint project, and we are using server 2010 as a Document Management system. The thing is our company has about 300 customers, and we have to create 300 site collections, 1 per customer.
For each site collection, I use the blank site template, and it's very simple page, as I just need a document library in the home page, and then I need to create a subsite called "cases" and the inside profiles, the users create a document library for each case. For subsite I mean, I create a new site and I choose the option to share the top menu, so basically the site has 2 tabs.
So basically what I need is a template that has 2 tabs, Home and Cases. Home with a document library in home and Cases empty. Is there a simple way to achieve this? I guess maybe I have to edit some XML files to create a Site Template. If this is the case, can someone point me to the right documentation.
Second, I need to create a Visual Basic project so that the final user has a form, and he just inputs the Customer Name and the code must automatically create a new site with the template I metioned before. I guess that once I have the template this won't be very hard to achieve, as I have seen this SPSite class. The question is, can I have the template with the 2 tabs, o maybe I have to use 2 templates, and write code to create the home site and the Cases Subsite..
Please could someone point me to the right approach and documentation?? Thanks.. regards..
Tuesday, September 7, 2010 10:38 AM
Answers
-
Hi Canarioo,
Welcome to SharePoint!
Because you will have a site collection that contains mulitiple sites, you will need to use a ProvisionAssembly and ProvisionClass in a web template. If you are using SharePoint Server there is one available out of the box that supports creation of publishing sites.
Here is an article on the subject that still applies to 2010. http://blogs.technet.com/b/wbaer/archive/2007/03/25/understanding-webtemp-xml.aspx
With regard to your second question the answer is the same. To provision mutliple sites with a template you need to use a webtemp with a ProvisionAssembly and ProvisionClass.
Alternativley, you can use the new WebTemplate feature element and provision and configure the subsite via a feature receiver. In this case, the WebTemplate's ONET.xml file includes a feature and the feature has an event handler for on activated. The root web is defined by the WebTemplate (XML) and all subsites and ancillary configuration are made via the object model.
--Doug
- Proposed as answer by Doug WareMVP Thursday, September 9, 2010 9:28 PM
- Marked as answer by GuYuming Tuesday, September 14, 2010 7:24 AM
Tuesday, September 7, 2010 1:20 PM
All replies
-
Hi Canarioo,
You should use SharePoint Designer 2010 for the purpose.
Thanks,
Anubhav Jain
Tuesday, September 7, 2010 12:22 PM -
Hi Canarioo,
Welcome to SharePoint!
Because you will have a site collection that contains mulitiple sites, you will need to use a ProvisionAssembly and ProvisionClass in a web template. If you are using SharePoint Server there is one available out of the box that supports creation of publishing sites.
Here is an article on the subject that still applies to 2010. http://blogs.technet.com/b/wbaer/archive/2007/03/25/understanding-webtemp-xml.aspx
With regard to your second question the answer is the same. To provision mutliple sites with a template you need to use a webtemp with a ProvisionAssembly and ProvisionClass.
Alternativley, you can use the new WebTemplate feature element and provision and configure the subsite via a feature receiver. In this case, the WebTemplate's ONET.xml file includes a feature and the feature has an event handler for on activated. The root web is defined by the WebTemplate (XML) and all subsites and ancillary configuration are made via the object model.
--Doug
- Proposed as answer by Doug WareMVP Thursday, September 9, 2010 9:28 PM
- Marked as answer by GuYuming Tuesday, September 14, 2010 7:24 AM
Tuesday, September 7, 2010 1:20 PM -
Excellent Doug.. After some research, I've been able to create the structure I wanted using the ProvisionAssembly and ProvisionClass.
No I have just one thing missing. In the ONET.xml for the partent and child sites, I'm trying to play with the Navigation options:
<Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA">
<Properties xmlns="http://schemas.microsoft.com/sharepoint/">
<Property Key="IncludeInGlobalNavigation" Value="true"/>
<Property Key="InheritGlobalNavigation" Value="true"/>
</Properties>
The thing is I can't get the subsite to appear in the Top Navigation Bar, even when I set the option IncludeInGlobalNavigation to true..
Any ideas??
Thanks.. regards..
Sunday, September 12, 2010 5:51 PM -
Excellent Doug.. After some research, I've been able to create the structure I wanted using the ProvisionAssembly and ProvisionClass.
No I have just one thing missing. In the ONET.xml for the partent and child sites, I'm trying to play with the Navigation options:
<Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA">
<Properties xmlns="http://schemas.microsoft.com/sharepoint/">
<Property Key="IncludeInGlobalNavigation" Value="true"/>
<Property Key="InheritGlobalNavigation" Value="true"/>
</Properties>
The thing is I can't get the subsite to appear in the Top Navigation Bar, even when I set the option IncludeInGlobalNavigation to true..
Any ideas??
Thanks.. regards..
I'm trying to do the same. I thought the navigation feature id was89e0306d-453b-4ec5-8d68-42067cdbf98e
I could be wrong. My Current Nav settings inherit fine, but for some reason the global doesn't.
Thanks in advance!
-Mike
Wednesday, September 29, 2010 4:46 PM