0

I have created a site definition, when creating a subsite my layout that I want to use doesn't get set?

How can I set my own default page layout when creating a subiste?

Here is my onet.xml img

Doing like this doesn't change my default publishing page layout

<Modules>
<Module Name="MyDef" Url="$Resources:osrvcore,List_Pages_UrlName;" Path="">
  <File Url="default.aspx" >
    <Property Name="Title" Value="$Resources:cmscore,IPPT_HomeWelcomePage_Title;" />
    <Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/FSF_Avdelningsplats_Elmia.aspx, $Resources:cmscore,PageLayout_WelcomeLinks_Title;" />
    <Property Name="ContentType" Value="$Resources:cmscore,contenttype_welcomepage_name;" />
  </File>
</Module>
0

You can set that in the publishing feature itself in onet.xml, basically in the publishing feature inside you web features, you should do something like this:

<WebFeatures>
 <Feature ID='Id for publishing feature'>
   <Properties xmlns="http://schemas.microsoft.com/sharepoint/">
    <Property Key="DefaultPageLayout" Value="~SiteCollection/_catalogs+masterpage/MyPageLayout.aspx"/>
   </Properties>
    </Feature>
    <!-- Other web features..-->    
</WebFeatures>
  • which is the Id for publishing feature? – Batistuta Mar 6 '15 at 11:02
  • i got this error. The establishment failed. Details: Failed to initialize some website features of the site with the URL : http: //portal.mydev.local/lop Original exception : No parameter less constructor defined for this object . – Batistuta Mar 6 '15 at 11:13
  • This error means you have a problem with your page layout, make sure that you don't have anything outside content place holders, and the ContentPlaceHolders are in the right case, it's different ContentPlaceHolder from contentplaceholder, revise your page layout. It should work – user19105 Mar 6 '15 at 11:15
  • Hi i have tried with other page layouts that i havent written anything in still got same error – Batistuta Mar 6 '15 at 11:35
  • Did you try to set the page layout manually in the site after creating the page? – user19105 Mar 6 '15 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.