SharePoint site definitions not showing up in template list -- why?

7k views Asked by At

I have some custom SharePoint site definitions that are deployed via SharePoint wsp solution packages. They appear to work fine. I can deploy them fine via the stsadm command line, and my C# code running in some features can also deploy sites based on them. My webtemp.*.xml files appear to be correctly placed in the 12\1033\XML folder when my solutions are deployed. My problem is that they just don't show up in the central admin app when I try to Create Site Collection. Why not? I don't even know where to look for this.


EDIT:

Hmmm.. About an hour later I happened to go back to the create site collection page and my templates were there. I'm not sure what was up... weird caching somewhere or something.

I also should have been more clear that these solution packages had been successfully deployed many times on my dev box, so I didn't expect there to be a problem (with the deployment aspect anyway) on this other server.

4

There are 4 answers

0
AudioBubble On

Many tasks in SharePoint are queued and then executed via timer job. An IISReset causes the web applicationt to be reloaded into memory and for configuration information for example the web.config to be reloaded.

To give SharePoint a "nudge" and cause jobs to execute you might try:

stsadm -o execadmsvcjobs
0
MrChrister On

Do you have the publishing feature enabled? I read that content types can't be saved in templates, so they don't allow publishing sites to be made into templates. This is perhaps linked to why they won't show you the ones you already made.

Although I don't have access to a central admin to verify, this is the case from within my site collection.

1
Nico On

Did you forget to run iisreset ? This is needed for SharePoint to reload site templates.

0
Jason S On

If you use the Record Center as the template for your root website, templates (.stp files) in your template library will not show up when creating a new list.

There is some weird bug that makes this happen.

Here is code that you can try running in the SharePoint PowerShell. The return value for GetCustomListTemplates($web).Count will be zero if you have the root web made from the Record Center template.

$site = get-spsite("http://localhost")
$web = $site.RootWeb
$list = $web.Lists["TestDocLibrary"]
$list.SaveAsTemplate("MyListTemplate.stp", "MyListTemplate", "My List Template", $false)
$site.GetCustomListTemplates($web).Count

More information can be found at the following links: