Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
    
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. –  Daniel Ziga Nov 30 '11 at 12:36
add comment

1 Answer 1

up vote 3 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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