Site templates are a great feature within SharePoint that allow us to build a Web Site, customise it then save it as a template or starting point for other Sites. For example a basic company site can be developed. Create a new site from this template and customise it to add say Sales Department specific content. The marketing department like the sales department site but want some changes – they simply create their site from the sales site template then make their own changes.
Another possible scenario on the Web – a SharePoint server dedicated to user groups or social clubs for example – one group builds their site containing common content (member list, Event dates, speaker lists) then other groups use templates to create their own and build from the common starting point rather than starting from scratch. No need for any developers at all :-(
Site templates as in ‘.STP’ files have gone from SP 2010. When a site is saved as a template a solution file (‘.wsp file’) is created and added to the new user solutions gallery. This is the gallery where sandboxed solutions are stored.
Before the template shows up as an item in the create site dialog it needs to be activated. Simply click on the template item in the User Solutions Gallery and from the menu select activate. This brings up a SilverLight dialog (if you have SilverLight enabled) where you are presented with a warning and an activate button. When I pressed this the activation went ahead and a new view of the user solutions gallery appeared within my SilverLight dialog – not sure if this is supposed to happen but it seems wrong - hopefully this will be sorted by RTM. Anyway I can now create a new site based on my template. Over time I will be testing this to see when I can use it and when not. For now I have been trying a few simple scenarios.
Scenarios tried so far
Simple blank site – saved and restored fine
Added simple workflow via Designer – new site is fine and workflow runs successfully
Amended workflow to add a task to the site owner (administrator) – saved a new template - created the new site from the template – all well.
Simple site with unique permissions - Added a user - Added tasks list and in workflow assigned task to the new user – site creation failed !
In the last scenario there were no ‘uls’ log entries to help and the error was a simple ‘An unexpected error has occurred’ – I suspect that because the user doesn’t exist in the site – I had hoped the template would include the users but maybe it’s better to keep security separate from the template mechanism – either way the error message doesn’t help much but this is beta code
The great thing is that the template is a solution file which can now be imported into Visual Studio 2010. If you are willing to learn the contents of the solution then it can be amended within Visual Studio ready for deployment to other servers. Although not an everyday requirement it shows that the development tools are being taken seriously and being integrated into the SharePoint infrastructure.