Posts

Showing posts with the label web templates

Powershell: Update "Subsite Templates" under AreaTemplateSettings.aspx

Hi, This time I am discussing about how one can update the "AvailableWebTemplates" once you have created a site. Just for the information, we can define this property in Onet.xml while creating any new site. But what if you have created sites, sub sites underneath and sub sub sites underneath, in that case you need a power shell script to update all those values. Background: This property is defined in Onet as shown below: <Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416"> ----------------- <Property Key="AvailableWebTemplates" Value="*-CMSPUBLISHING#0;*-BLANKINTERNET#2;*-ENTERWIKI#0;*-SRCHCEN#0"/> --------------------- </Feature> But once site is created using this site template, we have to dig down to update this. Using power shell its quite easy task provided you must know the Id and template name. Work Arround: We using the below mention code we can override the web template property. In order to update that we must know th...