Monday, November 13, 2006

Answer to comment - how to specify a category to a site template

Someone name "Seth" asked me today how to specify a category for a site template. Unfortunately Seth forgot to leave his email or contact number, so I will answer publicly.

I dont know how to do it for a saved template (saved by the "save as site template" function in site properties). But I do know that using Site Definitions its possible. Site definitions are registered by adding an xml file under "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML\" folder. The xml schema that declares a template looks like this:

<Template Name="SPSSITES" ID="34">
<Configuration ID="0" Title="Site Directory area template" Type="0" Hidden="FALSE" ImageUrl="/_layouts/images/template_site_dir.gif" Description="This template creates a site that lists important sites in your organization. It includes different views for Categorized Sites, Top Sites and the Site Map." DisplayCategory="Enterprise" />
</Template>

Notice anything bold? thats where you choose the category for the site template.
Using the new Visual Studio 2005 Extensions you can save a site into a site definition, and then change the xml as needed.

Questions?

No comments: