Friday, August 29, 2008

Including / Exculding a module from Site Definition based on Root level or child level web

Scenario:
As of part of definition you want to upload certain files based on weather its a Root Level Web or sub-site.

Solution:
To upload files, documents as a part of site creation , Site definition core file ONET.xml uses Module nodes, which support 'RootWebOnly'. Setting a value of TRUE for the same will result in upload of the files included in the Module only if it a Root Level Web.

Assuming that your Site Defintion name is 'ClientSiteDefinitionName' and you have a folder under that with the name 'WebParts' which contains 'MyCustom.webpart' file.

Snippet from ONET.xml:

<Module Name="CustomWebParts" List="113" Url="_catalogs/wp" SetupPath="SiteTemplates\ClientSiteDefinitionName\WebParts" RootWebOnly="TRUE">
<File Url="MyCustom.webpart" Type="GhostableInLibrary" />
</Module>

1 comments:

Term Papers May 14, 2010 at 8:19 AM  

I have been visiting various blogs for my term papers writing research. I have found your blog to be quite useful. Keep updating your blog with valuable information... Regards