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 have elements.xml with module:

<Elements>
  <Module Name="IntranetNewsPageLayout" Url="_catalogs/masterpage">
    <File Path="IntranetNewsPageLayout\IntranetNewsPageLayout.aspx" Url="IntranetNewsPageLayout.aspx" Type="GhostableInLibrary" >
      <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
      <Property Name="PublishingAssociatedContentType" Value=";#IntranetNews;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D00efac964741834409bf9e0e0d275d511d;#" />
      <Property Name="Title" Value="Intranet News Article" />
    </File>
 </Module>
</Elements>

So IntranetNews content type is used for page layout IntranetNewsPageLayout.aspx. I want to use same page layout for new content type. How to do this? Should i create new File section or maybe new Module section?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

You can do it via Visual Studio. Just add multiple file tags with different Url and refer as multiple content typesas follows:

<File Path="Website.Publishing.aspx" Url="Website.Publishing.aspx" 
        IgnoreIfAlreadyExists="TRUE" Type="GhostableInLibrary">
        <Property Name="PublishingAssociatedContentType" 
           Value=";#$Resources:res,ctype;;<content type id>;#" /> 
</File>
<File Path="Website.Publishing.aspx" Url="Website.SomethingElse.aspx" 
        IgnoreIfAlreadyExists="TRUE" Type="GhostableInLibrary">
        <Property Name="PublishingAssociatedContentType" 
           Value=";#$Resources:res,ctype;;<another content type id>;#" /> 
</File>

See an example: http://www.sharepointblues.com/2010/04/21/single-page-layout-for-several-content-types/

share|improve this answer
add comment

A page layout in SharePoint can only be tied to one content type. However, you can deploy the same layout under two different URLs and bind each to the separate content types, as they do here.

Another option that should work would be to create a single parent content type that has all of the required fields and bind the page layout to that type. You would then create child content types that inherit from the parent content type and the page layout would be available to them since they inherit from it. This approach is a little less explicit but would eliminate the need to have two identical layouts deployed to the _catalog.

share|improve this answer
1  
Dave, we can surely add multiple content types to one page layout through visual studio. –  Falak Mahmood Jan 6 '13 at 17:12
add comment

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.