Question

Is it possible to define a subsite in a webtemplate? I can't use a site definition because I'm working in Office 365 - SharePoint Online.

Wrong approach:
I thought about activating a site-feature in the ONET.XML of the rootweb so it would create the subsite when the rootweb is created. But webtemplates-features need to be activated on sitecollection-level. And because I'm working in Office 365 (so a sandboxed solution) all sitecollection-features are activated automatically.

Question:
Is there someone who knows how I can create and provision a subsite from my rootweb? Preferably with templates. If nothing else works, with code (but I'm working in Office 365 so I'll guess I need to use the client object model?)

Was it helpful?

Solution

There are different approaches on creating SubSites in your Office 365 SharePoint Online environment.

  1. Using a EventReceiver (Which can be a FeatureReceiver). U still need to create a template for the specific subsite, then use the receiver to create the subsite from that template using this: http://msdn.microsoft.com/en-us/library/ms411806.aspx Be aware that the timeout for a Sandboxed call is 30 secs. If you want to create a large subsite or multiple subsites this is probably not the best way.

  2. Using Client Object Model. You can write for instance a console application that implements the Managed Client Object Model for SharePoint. Still you will need a Template for the Subsite then use code to create the Subsite based on your template. This will get u started on the Client Object Model: http://msdn.microsoft.com/en-us/gg620623

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top