I'm trying to add some custom page layouts to an existent wsp solution for SharePoint 2013, I have edited the element.xml and the features.xml. The file is uploaded and I can see it with SharePoint designer but it is not recognized as a pagelayout.

I tried a sample snippet from the 2010 version but it doesn't work for the 2013, bellow is the code that I used.

<Module Name="_catalogsmasterpageAteaRapidpagelayouts_" Url="_catalogs/masterpage" RootWebOnly="FALSE" Path="Files\_catalogs\masterpage">           
    <File Path="masterpage\teste.aspx" Url="teste.aspx" Type="GhostableInLibrary">
      <Property Name="Title" Value="My Custom Page Layout" />
      <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
      <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/CustomPageLayout.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/CustomPageLayout.png" />
      <Property Name="PublishingAssociatedContentType" Value=";#$Resources:cmscore,contenttype_articlepage_name;;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D;#"/>

Building the wsp again with the visual studio is not an option.

Anyone have the snippet code to add the page layout to the 2013?


Try writting this code in your Elements.xml

<Module Name="Layout" Url="_catalogs/masterpage">
  <File Path="Layout\teste.aspx" Url="teste.aspx" Type="GhostableInLibrary">
    <Property Name="Title" Value="Layout Intranet Home"></Property>
    <Property Name="PublishingAssociatedContentType" Value=";#$Resources:cmscore,contenttype_articlepage_name;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39002211F99918BD4D80B8E1DEF7585F0F9A;#" ></Property>
    <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;"></Property>

This code works for me. Look at this piece of your code #$Resources:cmscore,contenttype_articlepage_name;; You have double ;;

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.