This is the first part of a multipart series of posts that will teach you how to leverage the Save Site as Template and Import SharePoint Solution Package features to facilitate development and creation of page layouts and publishing pages via Visual Studio and SharePoint solution packages. If you arrived at this post because you’d like to be able to save a publishing site as a template and deploy the resulting template, I am sorry to say that that is simply not possible.
Before you get started with this series you should read two posts I wrote a couple of years ago to get a handle on the basic techniques.
Save Site As Template + Import SharePoint Solution Package == Love
How to Copy Feature Elements in Visual Studio SharePoint Solutions
If you found this post, you probably already know that the Save site as template link does not display on the Site Settings page of a publishing site. There is a good reason for this; SharePoint cannot produce a working template from a publishing site! However, it is possible to access the functionality by navigating directly to a page, and a developer can use the contents of the resulting package in their own packages provided she knows what to fix and how to fix it.
In this series of articles I’ll teach you how it is done using a sample page layout and a sample publishing page. The result will be a deployable solution that properly provisions the page layout and the page based on the layout.
I created my sample page layout using SharePoint Designer 2010. It is a copy of the ArticleLeft.aspx page layout and, just like the original, it uses the out of the box Article Page content type. I gave it the very imaginative name of Sample.aspx.
My publishing page has an equally creative title, Sample-Page.aspx, and it contains some formatted text and a Content Editor Web Part within the Page Content field. It looks like this:
Table of Contents
Using Save Site as Template with Publishing Sites – Introduction
Using Save Site as Template with Publishing Sites – Part 3, Fixing Up the Page Layout Module
Using Save Site as Template with Publishing Sites – Part 4, Fixing Up the Publishing Module
Using Save Site as Template with Publishing Sites – Conclusion
Author: Doug Ware