The template you have chosen is invalid or cannot
I was receiving the following message when trying to create a new Site Definition by following the steps in Chapter 4 of the SharePoint 2007 Development book.
"The template you have chosen is invalid or cannot be found"
I learned that you need to be very careful to avoid conflicts with IDs already used in Windows SharePoint Services. It is suggested to use UNIQUE values greater than 10,000 for the ID attribute. Also the template ID must be unique from the ID's used in all the webtemp.xml files, i.e. don't have two that specify ID="10001".
In my case my XML looked like this:
<?xml version="1.0" encoding="utf-8"?>
<Templates xmlns:ows="Microsoft SharePoint">
<Template Name="SAMPLE" ID="10001">
<Configuration ID="0" Title="Sample Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="Blah blah blah." DisplayCategory="Custom Site Definitions" > </Configuration>
</Template>
</Templates>
By changing the ID to 10004 the problem went away. I didn't realize, or had forgotten, that I had used the ID of 10001 previously for another template. My correct XML was:
<?xml version="1.0" encoding="utf-8"?>
<Templates xmlns:ows="Microsoft SharePoint">
<Template Name="SAMPLE" ID="10004">
<Configuration ID="0" Title="Sample Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="Blah blah blah." DisplayCategory="Custom Site Definitions" > </Configuration>
</Template>
</Templates>
The next template I create will have an ID of 10005, the one after that 10006, etc.......
|