AvailableWebTemplates

转自:http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/33a3d2f4-3a17-4812-93f8-1434499b976e/

 

Jason D. Nadrowski - Posted on 2007年2月8日 2:28:49

In customizing the internet publishing site definition, I noticed there is an option to limit the available template(s) for any subsites that are created in a site collection.  The "AvailableWebTemplates" is what does it.  By example, I understand how to limit it to only ONE template -- see below.  I am guessing the "*-" means remove all templates and the subsequent text is of the form <ConfigurationName>#<ConfigurationID>. 

<!-- Snippet from my custom ONET.XML -->
<
Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416">
  <!--
Publishing -->
  <
Properties xmlns="http://schemas.microsoft.com/sharepoint/">
    <
Property Key="ChromeMasterUrl" Value="~SiteCollection/_catalogs/masterpage/mycustom.master"/>
    <
Property Key="WelcomePageUrl" Value="$Resources:cmscore,List_Pages_UrlName;/default.aspx"/>
    <
Property Key="PagesListUrl" Value=""/>
    <
Property Key="AvailableWebTemplates" Value="*-MyTemplateName#1"/>
    <
Property Key="AvailablePageLayouts" Value=""/>
    <
Property Key="AlternateCssUrl" Value="" />
    <
Property Key="SimplePublishing" Value="false" />
  </
Properties>
</
Feature>

However, I have not been able to figure out how to limit it to TWO or more templates.  I have tried all sorts of combinations and delimiters to no avail.  Some help on the syntax for TWO or more templates would be MUCH appreciated. 

  • Christian Gram - Posted on 2007年4月17日 18:36:28

    Hi Jason

     

    I don't know if you have found the solution,   Bernado in this this link sugest

    <Property Key="AvailableWebTemplates" Value="*-[siteDef];*-[siteDef],*-[siteDef]"/>
    like this

    <Property Key="AvailableWebTemplates" Value="*-STS#0;*-STS#1"/>

     

    I have a similar problem with AvailablePageLayouts, I can't find a way to allow more than one pagelayout.

     

    Regards

    Christian

  • Renatas Lauzadis - Posted on 2007年4月23日 9:23:14

     

    If you look at the search site template you will notice that it uses following syntax:

    <Property Key="AvailablePageLayouts" Value="~SiteCollection/<site collection relative path1>:~SiteCollection/<site collection relative path2>:~SiteCollection/<site collection relative pathX>"/>

     

    Good luck!

    Renatas.

  • Christian Gram - Posted on 2007年4月24日 5:00:02

    Hi Renatas

    : looks like the answer, I thought I tried everything, but this works

    Thanks

    Cheers

    Christian

  • posted on 2008-11-08 18:12  王丹小筑  阅读(261)  评论(0)    收藏  举报

    导航