Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Custom Content Type in Site Definition?

Status
Not open for further replies.

satyamamin

Programmer
Oct 20, 2008
2
FR
Hello,

Normally when you create a new publishing site in MOSS it automatically gets a default page created using the WelcomeLinks.aspx page layout. But I have changed this behavior like below and created a page based on custom content type and page layout of my choice.

Inside ONET.XML file, there is a modules section (as below), it defines the PublishingPageLayout and ContentType to be used when a site is created.

<Modules>
<Module Name=”Home” Url=”$Resources:cmscore,List_Pages_UrlName;” Path=”">
<File Url=”default.aspx” Type=”GhostableInLibrary” Level=”Draft” >
<Property Name=”Title” Value=”$Resources:cmscore,IPPT_HomeWelcomePage_Title;” />
<Property Name=”PublishingPageLayout” Value=”~SiteCollection/_catalogs/masterpage/MyPageLayout.aspx, ~SiteCollection/_catalogs /masterpage/MyPageLayout.aspx” />
<Property Name=”ContentType” Value=”MyContentType” />
<Property Name=”PublishingAssociatedContentType” Value=”;#MyContentType;#0×010100C568…3A09F31E1FBA;#” />
</File>
</Module>
</Modules>

But my custom content type doesn't work(apply) for available page layout first time, when I create new site collection by selecting custom site template. It works fine, when I create new page by selecting my page layout with custom content type.

Does anyone has any idea why it behaves strange in my case. Thanks for your help in advance..

Regards,
Satyam AMIN
 
Finally I found the solution what I was looking for. Simply I need to create one more feature which binds my custom content type with pages and added this feature in site definition under web feature tag.

For more information about my issue and solution, go through following URL.

1)
2)
3)
4)
Regards,
Satyam AMIN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top