0

I am following the following article about Creating a Page Layout in SharePoint 2010 using Visual Studio 2010. I have deployed the solution but when I click on page layout my new type is not there.

My Mastaerpage Gallery is as follows:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="MasterPageGallery"
  Path="MasterPageGallery"
  Url="_catalogs/masterpage" >
    <File Url="my.master" Type="GhostableInLibrary" >
      <Property Name="UIVersion" Value="4" />
      <Property Name="ContentTypeId" Value="0x010105" />
    </File>
    <File Path="myintranet.aspx" Url="myintranet.aspx" Type="GhostableInLibrary">
      <Property Name="Title" Value="my Intranet Page" />
      <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
      <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/mypage.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/mypage.png" />
      <Property Name="PublishingAssociatedContentType" Value=";#$Resources:cmscore,myintranet_articlepage_name;;
#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237my3900242457EFB8B24247815D688C526CD44D;#"/>
    </File>
  </Module>
</Elements>

My Preview Images module is as follows:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Previews Images" Url="_catalogs/masterpage/$Resources:core,Culture;/Preview Images">
    <File Path="Preview Images\mypage.png" Url="mypage.png" Type="GhostableInLibrary">
      <Property Name="Title" Value="my Intranet" />
    </File>
  </Module>
</Elements>

My feature contains the files. It deploys correctley. If I browse to _catalogs/masterpage/mypage.png no file is found.

Where am I going wrong? How can I debug this?

3 Answers 3

2

I think your preview image file could be browsed at _catalogs/masterpage/en-us/Preview Images/mypage.png (I'm assuming your culture here is en-us).

As for your PageLayout

  • Can you see it in your master page and page layouts gallery? (Settings > Galleries > Master pages and page layouts)
  • Is your page layout allowed to be used on the site? (Settings > Look and Feel > Page Layouts and site template)
  • Is the content type specified by PublishingAssociatedContentType bound to the pages library you are trying to create the page?

Also, what is the content type ID in the PublishingAssociatedContentType property? Custom or OOB? It seems to be the content type Id for the OOB Article Page except you have "my" in the ID where it should have "AF".

3
  • To confirm the image is there in the en-us folder. The masterpage and the aspx page are in the "Master pages and page layouts" The page is not listed under "Settings > Look and Feel > Page Layouts and site template".
    – John
    Oct 24, 2011 at 13:23
  • "Is the content type specified by PublishingAssociatedContentType bound to the pages library you are trying to create the page?" Not a clue
    – John
    Oct 24, 2011 at 13:26
  • Fixed the last point about he af
    – John
    Oct 24, 2011 at 13:28
0

Did you get resolution to this John?

Your preview image module looks correct (setting the path to "Preview Images\preview.png"), but it is important to note that your preview image will actually be placed in _catalogs\masterpage\en-US\Preview Images\ and your "PublishingPreviewImage" property for your page layout (in that elements file) should point to this location, ie: ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/preview.png.

1
  • Not working yet will take another look this morning.
    – John
    Oct 25, 2011 at 8:12
0

Is the page layout checked in and approved in the master page gallery?

I had this exact same problem earlier today and that was the issue (it was checked out upon provisioning). Still unsure why this is, previous projects I've worked on automatically check them in.

3
  • 1
    Just to add - If that is indeed the problem, you should be able to solve it by adding the line "<Property Name="vti_level" Type="int" Value="1"/>" to your module definition so that the item will be automatically provisioned in a "Published" status.
    – SPArcheon
    Oct 25, 2011 at 7:22
  • Awesome, didn't think of that.
    – James Love
    Oct 25, 2011 at 7:30
  • Eheh.. just don't try to use the "Level" property as per MSDN documentation. The feature schema is incomplete and supports only the "Draft" level.
    – SPArcheon
    Oct 25, 2011 at 8:03

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.