SharePoint - AvailableWebTemplates Key Format?
Asked By bernado
07-Feb-07 04:47 PM
I'm attempting to setup a custom Publishing site definition. I've
successfully created the site def and added it to the webtemp*.xml area,
setup the provisioning provider, etc. Everything worked just great to get
started with basically copied code from BlankInternet and Publishing site
defs with just tweaks to the names and ID's where necessary.
So, my question is fairly simple, but, simply can't find this information
anywhere (not the MOSS SDK, nowhere on MSDN, in the wild, etc).
The following format seems to block all subweb site defs from showing in the
available Site Templates in a Publishing Portal:
Property Key="AvailableWebTemplates" Value="*-CUSTOMBLANKINTERNET#2"
So, what format is needed to allow more than one site to be selected?
I've tried several combinations and delimiters, but all of them seemed to
result in all hidden=false sites being visible. Not what I had in mind...
;-)
Thanks all,
B
bernado replied...
Ok, so I figued it out...
If anyone else out there is struggling with this hopefully this will help:
To provision a top level site, and, restrict the sub sites that can be
created from that top level site using the SP UI, use the following format:
Property Key="AvailableWebTemplates"
Value="*-[siteDef];*-[siteDef],*-[siteDef]"
The syntax is weird, and it took me a bunch of trial and error to figure
this out, but, it works great. If anyone out there knows where some
additional documentation on this can be found, please reply to this post. I
couldn't find it anywhere.
JRos replied...
I'm trying to accomplish the same thing - but I'm having trouble figuring out
where to begin with creating a new Publishing Site Definition. There are
several examples of how to do this with the Team Site Definition. Can you
help to fill in the blanks about how you do this for the Publishing Site?
You are right, this information is very tough to come by! Any help would be
most appreciated!
bernado replied...

Yep, I found the same type of STS stuff, not what I was looking for either.
The Publishing site (as you no doubt have discovered) seems to use leverage
about every method known to the MOSS world to create its self. So, I started
by trying to follow the tracks through the labrynth of XML files to figure
out what was happening. Basically is goes like this:
in webtempsps.xml there is a "BLANKINTERNETCONTAINER" template that uses the
PortalProvider. The provider uses the InternetBlank.XML file listed in the
template to call other site templates (there is some information on this
which I found later in the MOSS SDK, get that, it is helpfull and free) to
provision all the stuff at once.
Using that information, I copied/pasted the "BlANKINTERNETCONTAINER" site
def and renamed my site defs as needed. Then I added a custom
WEBTEMP-MYSITEDEFS.XML file to the 1033 dir so MOSS would find my new site
defs which included a new template also using the portal provider (just
copied/pasted the code and changed where necessary and created my own
InternetBlank.xml file).
From there I began picking through each propery and tweaking stuff that I
need to change in the ONET.XML files in my new site defs.
If you need more info, hit me off the list at:
bernie DOT johnsen AT cudenver DOT edu
sorgy.publi replied...
See
Microsoft.SharePoint.Publishing.PublishingWeb.SetAvailableWebTemplates
using Reflector
AvailableWebTemplates Key Format is:
LCID-[sitetemplatename][#sitetemplatenumber];LCID-[sitetemplatename]
[#sitetemplatenumber];LCID-[sitetemplatename][#sitetemplatenumber]
1033-BALANKINTERNET#1;1049-BALANKINTERNET#1;*-BALANKINTERNET#2
*-BALANKINTERNET#2 - ALL Languages
bernado replied...
Great stuff. Thanks!
Were'd you find this information? I looked about everywhere I could think,
including the SDK (I think), and I didn't see this. Maybe it is a newer
edition of the SDK?
Thanks again for posting this, the "*-" syntax makes sense to me now.
B
sorgy.publi replied...
I was looking for this information for 3 months. And I have found this
just 30 minutes ago. Only reflector help me some time. There is no
information about this in SDK (as usual).
Parthi replied...
Hi,
I added this part to MySiteDef that I created from STS Site def and it seems to work fine (please let me know if I am wrong). I did not create from BLANKINTERNET site def.
The only problem is that i have a default.aspx page in root (from STS site def), but the site gets redirected to pages/default.aspx as home page since it includes this publishing feature.
Other than that i have all the custom lists i added in MySiteDef available.
Am i missing some thing here??
bernado replied...
...
...
I haven't tried this, but, I suspect that is what you are looking for.
Good Luck. Let us know if it works!
Bernadou
**** **** replied...

Bernado,
It does work!! (Hopefully no hidden problems)
Newly created site out of this site def. has publising features, and also it has Basic Site Tempalate files.
This is feature node i added in cofiguration section on onet.xml for a team site with some custom webparts in default.aspx
<Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416">
<Properties>
<Property Key="AlternateCssUrl" Value="~SiteCollection/_styles/core.css" />
<Property Key="WelcomePageUrl" Value="default.aspx" />
<Property Key="AvailableWebTemplates" Value="*-MySiteDef#0" />
</Properties>
</Feature>
interesting this here is that since in specified "WelcomePageUrl" as a property, SharePoint did not create a default.aspx publishing page in "Pages" document library. It used the default.aspx created from Team Site as welcome page! All the default Lists and document libraries are created for publishing site, but nothing in them.
My default.aspx page (with my cusom webparts) from Team Site is now the default page for my site.(which is what i wanted). Great!!!
One more good thing here is that users can select only one site from Site Creation page from this current site and all its subsites.("AvailableWebTemplates" property). Again great !!!
Now i also have the flexibiliy to do conditional site creation template to show for users for different sites (using "AvailableWebTemplates" property for different sites)!!
but now the problem for me is to restrict users from creating Meeting Workspace from Event list. Since the site is from "Team Site" site def., Meeting Workspace creation page shows all the out-of-box available WS sites.
Any one has any idea to go further from here?
Thanks
Parthi
bernado replied...

Very cool. Glad that worked for you...
If I understand what you want to do, it seems like you now want to do this...
You can globally hide any site definition (but this will apply to all web
apps on this box if you do this...) by setting the Hidden="False" property to
true in the webtemp.xml file for the site def you want to hide.
So, MS owns certain things in the SP, and, they reserve the right to
overwrite your changes if you decide you are going to mess with them when
they release a service pack, so, I made a copy of the webtemp.xml file,
called it webtemp-hide.xml and put it in the same directory
...12\TEMPLATE\1033\XML. I then changed the Hidden key to true
(Hidden="True") for any site def I didn't want to be available ever (we have
a fairly controlled environment).
You'd probably want to do this...
ImageUrl="/_layouts/images/mwsprev.png" Description="A site to plan,
organize, and capture the results of a meeting. It provides lists for
managing the agenda, meeting attendees, and documents."
DisplayCategory="Meetings" > </Configuration>
Good Luck!
B
**** **** replied...
Thanks for the suggestion, but i can not do that since we are in a shared environemnt. :(
I also noticed that even you restrict the available Work Space (Meeting) templates for subsites using "Page layouts and site templates", creating a Work Space from a Events list on the same site is not working.
This seems wrong though. Is this a know BUG?? Can you please give your insight on this??
Thanks
Parthi
project con sharepoint SharePoint SharePoint Portal Server Dev Discussions Sharepoint (1) Laurent (1) Cotton (1) Conectarme (1) Intentar (1) Liliana (1) Error (1) Project (1 Laurent Cotton www.bewise.fr es un error que sale al intentar conectarme con el sharepoint keywords: project, con, sharepoint description: !- - Web.Config configuration File- - configuration system.web customErrors mode = On deafaultRedirect = mycustompage.htm system
access into sharepoint SharePoint Sharepoint is new to my organisation and we are on the verge of deploying it to and import those? How have others resolved this issue? Your help is most appreciated, Matt SharePoint Discussions SharePoint (1) InfoPath (1) WSS 3.0 and MOSS 2007 (you didn't say which SharePoint product *and version* you were asking about) allow you with Access 2007 to synchronize (in both directions) Access tables and SharePoint Lists. It probably works in both directions (with some restrictions on field types used) although and then open that file using the template you created in InfoPath. keywords: access, into, sharepoint description: Sharepoint is new to my organisation and we are on the verge of deploying
Office SharePoint, Windows SharePoint and SharePoint Portal SharePoint Hi, I am a novice about SharePoint. Can anybody tell me if Office SharePoint, Windows SharePoint and SharePoint Portal are same thing? same server application? or what is the different among them? Thanks
Using a Windows Application to publish Office files to SharePoint SharePoint SharePoint 2.0, Office 2003, VS 2K5 In creating an automated document management Windows application, I need to be able to programmatically save (publish) various documents (.doc, .xls, .pdf, .tiff) to SharePoint, but I don't know which assembly to use. I tried system.io, but that on the URI class and WebRequests, but I just don't get it. Thanks, Ross SharePoint Development Discussions SPDocumentLibrary (1) SPListItem (1) SPList (1) SPSite (1) SPWeb (1) SharePoint (1) Lists.UpdateListItmes (1) Office 2003 (1) If you are using the windows application on a box that has access to the SharePoint server and SharePoint dll's, I would use the Microsoft.SharePoint namespace. If you used that namespace, you
wiki sharepoint SharePoint Hi Does someone know if there are any good wiki webparts available for sharepoint SharePoint Discussions Sharepoint (1) Webparts (1) SharePoint v3 (MOSS 2007 and WSSv3) includes Wiki functionality. Engelbert Have you heard about the Wiki to this work. Ben Aloha derksj, For 2003 I don't know of any, but SharePoint 2007 has a Wiki template included out of the box. -Ben- Ben M. Schorr - MVP http: / / www.rolandschorr.com Microsoft OneNote FAQ: http: / / www.factplace.com / onenotefaq.htm keywords: wiki, sharepoint description: Hi Does someone know if there are any good wiki webparts available for sharepoint