2007-03-12

Creating Complex Portal Site Templates

Creating large portal site templates that are involving provisioning of many differente webs, sites and custom lists are a challenging task - not how to do it but managing all those details in the onet.xml files. I've done it for one of mye customers, and below is a descripion of the steps that are involved, which files to customize and possible pitfalls or errors that should be avoided.

First, the following files are a part of a Portal Site Template:

  • [12]\templates\1033\xml\webtemp_myportalsite.xml - all the site templates that are used and pointers to where they configurations my be found
  • [12]\templates\sitetemplates\myportalsite\*.* - the site configurations. I've collected all my custom templates in on directory.
  • [12]\templates\sitetemplates\mywebmanifests\myportalsite.xml - the portal site definition with all the webs and sub webs which it contains and which sould be provisioned.
  • [12]\resources\myportalsite.resx - resources used in the portal site and the site defintions. It's a good idea to use a resource file beacause you then can change titles, descriotions, names, locations, etc without entering the onet.xml file which becomes very large.

Suggested process

  • Design the portal site template with all its contents in SharePoint. Build the structure, the web part zones, page layout, master pages, etc. that will be needed. The result of this process is what you then will bring into the Portal Site template. If the structure and content is not well defined when you start it will be more time consuming to do make changes in the onet.xml file.
  • Create a "dummy" team site which includes ALL the web part types that you have used in your portal site.
  • Run SharePoint Solution Generator on the "dummy" team site to create a site template. The content of this template you can then cut and paste in all the site templates that are included in you owen portal site template. Saves you a lot of time and uneccessary cursing :-)
  • Identify all the different site templates that will be needed and enter these into the webtemp_myportalsite.xml file
  • Build the portal site structure in the mywebmanifest\myportalsite.xml file
  • Build the site templates in the sitetemplates\myportalsite\* catalog and the corresponding onet.xml file
  • Adding web parts to the definition. Export the web part from the site and cut and paste the web part data/definition into the onet.xml file.

No comments: