Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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;#"/>
    </File>
</Module>

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?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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>
  </File>
</Module>

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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