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.

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?)

  • I am not super familier with Office365, but is it possible to create and deploy EventReceivers, if yes, then this I believe would help you. – user2536 Nov 30 '11 at 12:36

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.