Sunday, August 24, 2008

Controlling Site Template availablity as Root / Child level

Scenario:
You want to make site template visible only for the Root Web site creation.

Solution:
While deploying the new site definition, you can specify 'SubWebOnly' or 'RootWebOnly' attribute in the WebTemp* file as shown below.

Snippet:
This will make Site Definition available at Root level only in the site collection.

<Template Name="ClientRootSite" ID="1540">
<Configuration ID="0" Title="Client Root Site" RootWebOnly="TRUE" Hidden="FALSE" DisplayCategory="Client Sites" ImageUrl="../images/clientsiteimage.gif" Description="This site will be used for creating a top level site only."> </Configuration>
</Template>


This will make Site Definition available at Child level only ( Subsites created within the site collection )

<Template Name="ClientChildSite" ID="1541">
<Configuration ID="0" Title="Client Child Site" SubWebOnly="TRUE" Hidden="FALSE" DisplayCategory="Client Sites" ImageUrl="../images/clientsiteimage.gif" Description="This site will be used for creating a child level site only."> </Configuration>
</Template>

0 comments: