8

What is currently the best way to add a template for site collections and subsites?

Background: Vesa Juvonen wrote a good blog post in 2010 about declarative web templates over site definitions. However, recently he preferred remote provisioning. Richard diZerega (also from Microsoft) has blogged about declarative sandbox, self-service site provisioning using apps and "app stapling".

What would be the preferred way today when an organization would be implementing SP2013 now, and later on either moving to O365 or upgrading on-premises once again.

3
  • Where should I create the .master page? In the provider hosted app or in SharePoint?
    – Alvmad
    Feb 24, 2014 at 15:15
  • Difficult question. Despite the app model being 'the future' and app based solution compatible with O365 + requiring no downtime for updates the SharePoint based solution has a good ace in its sleeve: You only need to update one ghosted file in file system to deploy updates to potentially thousands of sites. I think that in most cases, especially for large deployments, I would still go with the traditional SharePoint based solution for master pages.
    – thomius
    Feb 24, 2014 at 16:12
  • The provider-hosted app could, for example, activate a server-side feature for deploying the branding files.
    – thomius
    Feb 24, 2014 at 17:27

1 Answer 1

5

If your final goal is migration to SharePoint Online (SPOL) you definately need to think this into your branding approach.

WebTemplates were our choice for SharePoint 2010 on-premises solutions, since they have a much better upgrade story than custom site definitions. We have also long ago dropped the declarative approach for other artifacts and for SharePoint 2013 we have dropped solutions and features all together. As mentioned (especially in comments) in Vesas article about declarative/code solutions it is mentioned several times that many of the problems with the declarative approach is due to features and solutions that may or may not be retracted/removed.

Our approach is maybe a bit extreme, but we have developed a complete framework for deployment in PowerShell that uses CSOM in SP2013.

This approach means that we use the exact same approach for branding on-premises and cloud solutions.

Since what you can do in SPOL is limited compared to on-premises, we do not use templates at all. Instead we brand using custom master pages, page layouts and themes.

This means that our minimal branding "package" simply is a couple of master pages (V15 system and default master), some custom page layouts, some js files (angular and jquery), some custom CSS files (since themes just doesnt cut it) and custom theme (.spcolor and .spfont files).

We then as part of our module has code that uploads the artifacts to the relevant galleries and libraries, code that apply themes, content types, masterpages etc but that is really mostly convenience so that we can do reproducable deployments across environments. You can choose to do all this using the browser or even (god forbid) using SharePoint designer.

10
  • 1
    Nice approach Anders. Could you please tell some of the cons of using web template in SPOL.
    – Garima
    Dec 19, 2013 at 5:16
  • 2
    Well apart for the general confusion about sandbox solutions, and the story mentioned in the referenced articles about the general problems with solutions and features, the truth is we really dont need them! Onet.xml is nothing but a manifest that tells SharePoint what features to enable/disable. If you deploy a master page it is automatically inherited for subwebs so the branding works without web templates Dec 19, 2013 at 13:40
  • How would you implement self-service site creation? Could we for example add a link in suitebar via PowerShell to an external location which provides a web UI for provisioning content to the created site collection (via CSOM)?
    – thomius
    Dec 20, 2013 at 9:31
  • I think we are wondering a bit off-topic regarding original question? :-) This probably qualifies as a new question as SSSC is another topic entirely than branding/templates Dec 20, 2013 at 9:34
  • I thought SSSC would be the default (in largish organizations at least).. but just curious, are you allowing end users to create sites in a custom UI?
    – thomius
    Dec 20, 2013 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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