2

I have created a site that I want to make into a template and deploy a copy of roughly once a week. I want each new site to contain a standard set of libraries and folders (I have those - fine so far), but I want to populate some of those folders with standard files. The files would derive from site content type templates. What I really want is for those files to feed dynamically from the content type template, so when I update the template then the corresponding file in a newly created site will reflect the update when it is generated.

Any ideas? I know it can be done as I've seen it, years ago in fact... I look forward to hearing from beings superior to myself!

1

This can be done in 1 of 2 ways. But I think the question is; which way do you prefer, and what are the requirements.

  1. When you save the site as a template, you can include content from libraries to be saved in this template as well. This way the folders in your document libraries have standard files. But keep in mind that the size limit of a site saved as a template is 50MB.
  2. On the site collection you deploy this site template to, you can create an EventReceiver which will trigger on site provisioned.
    Using this approach you will have to write custom code that imports the standard files you're talking about and add them to the folders in the document libraries. I would suggest this approach if you have files that would exceed the 50MB limit Site templates have.
|improve this answer|||||
  • Thanks Daniel, I appreciate that. What I'm trying to do is populate the site libraries on creation of the site, as if the user had selected Document > New Document > {content type}, and therefore no matter when the content type template was updated, the new site will always be provisioned from the most up to date template - your option 1 won't achieve that, but will your option 2? – Mike J Jul 10 '15 at 13:41
  • @MikeJ Sorry for the late answer; Yes, option 2 will achieve this. In your code you specify the Content Type to use. If the content type is up-to-date on the site collection, then the code will automatically use the latest version. – user2536 Jul 12 '15 at 18:11

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.