4

I have a bit of a conundrum.

I've built a Visual Studio solution for SharePoint 2010. It comprises of a custom master page and a bunch of page layout templates. I've

  • Assembled a master page
  • Assembled a series of page layouts
  • Put together content types for the page layouts
  • Includes associated imagery, JQuery and CSS files

Everything deploys fine, the templates work, etc. However, when I come to insert a webpart into one of RichHTMLFields on any of the custom page layouts, it inserts the code fine from what I can tell. However, the webpart itself doesn't render. I've tested to make sure it isn't the master page (the webparts render using my custom master page and a default SharePoint page layout). I've completely replaced the site collection and created a new one from scratch and still the same problem

Looking at the logs at the verbose level, it appears that the webpart is doing the proper calls, but it simply isn't rendering any HTML.

I've added a web part zone onto the custom page and that renders the webparts fine. It appears that webparts added to any of publishing HTML placeholders fields that were added as part of the solution package aren't rendering. If so, are there any considerations I need to make for the custom content types? I've included the code below:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Field ID="{8BC9F870-8B18-40be-BBC7-B2D42DBC5F07}" Name="Body-Main" DisplayName="Body" Type="HTML" Required="FALSE" Sealed="FALSE" Hidden="FALSE" Group="XXXColumns" HTMLEncode="TRUE" RichTextMode="FullHTML" RichText="TRUE" Overwrite="TRUE" />
  <Field ID="{228E2E47-74C7-4796-A157-4381B5FD04E8}" Name="Highlight-Box-1" DisplayName="Highlight Box 1" Type="HTML" Required="FALSE" Sealed="FALSE" Hidden="FALSE" Group="XXXColumns" HTMLEncode="TRUE" RichTextMode="FullHTML" RichText="TRUE" Overwrite="TRUE" />
  <Field ID="{5BB76197-183C-4469-A0DE-96FE59A94F17}" Name="Highlight-Box-2" DisplayName="Highlight Box 2" Type="HTML" Required="FALSE" Sealed="FALSE" Hidden="FALSE" Group="XXXColumns" HTMLEncode="TRUE" RichTextMode="FullHTML" RichText="TRUE" Overwrite="TRUE" />
  <Field ID="{42FCA54F-736D-4571-BF95-0A8579C33E33}" Name="Link-List" DisplayName="Link List" Type="HTML" Required="FALSE" Sealed="FALSE" Hidden="FALSE" Group="XXXColumns" HTMLEncode="TRUE" RichTextMode="FullHTML" RichText="TRUE" Overwrite="TRUE" />
  <Field ID="{C5CDAC2B-8FF4-4c13-80FA-504AB2754BC6}" Name="News-Feed" DisplayName="News Feed" Type="HTML" Required="FALSE" Sealed="FALSE" Hidden="FALSE" Group="XXXColumns" HTMLEncode="TRUE" RichTextMode="FullHTML" RichText="TRUE" Overwrite="TRUE" />
  <!-- Parent ContentType: Page (0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39) -->
  <ContentType ID="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390066034fe9c0e14ea1aa04c334979ebf43"
               Name="PublishingColumns"
               Group="Publishing"
               Description="Content types used for publishing pages"
               Inherits="TRUE"
               Version="0">
    <FieldRefs>
      <FieldRef ID="{8BC9F870-8B18-40be-BBC7-B2D42DBC5F07}" Name="Body-Main" />
      <FieldRef ID="{228E2E47-74C7-4796-A157-4381B5FD04E8}" Name="Highlight-Box-1" />
      <FieldRef ID="{5BB76197-183C-4469-A0DE-96FE59A94F17}" Name="Highlight-Box-2" />
      <FieldRef ID="{42FCA54F-736D-4571-BF95-0A8579C33E33}" Name="Link-List" />
      <FieldRef ID="{C5CDAC2B-8FF4-4c13-80FA-504AB2754BC6}" Name="News-Feed" />
    </FieldRefs>
  </ContentType>
</Elements>

Also, here's an extract of the elements.xml for the page layout templates:

<File Path="MasterPages\XXX-ContentCommon.aspx" Url="XXX-ContentCommon.aspx" Type="GhostableInLibrary">
  <Property Name="PublishingAssociatedContentType" Value=";#XXXPublishingColumns;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390066034fe9c0e14ea1aa04c334979ebf43;#" />
  <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
  <Property Name="Title" Value="XXXStandardPage" />
</File>
<File Path="MasterPages\XXX-RegionalFrontpage.aspx" Url="XXX-RegionalFrontpage.aspx" Type="GhostableInLibrary">
  <Property Name="PublishingAssociatedContentType" Value=";#XXXPublishingFrontPages;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390066034fe9c0e14ea1aa04c334979ebf43001a71cc520ade4cc3bd773272c0354398;#" />
  <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
  <Property Name="Title" Value="XXXRegionalFrontpage" />
</File>
<File Path="MasterPages\XXX-NewsArticle.aspx" Url="XXX-NewsArticle.aspx" Type="GhostableInLibrary">
  <Property Name="PublishingAssociatedContentType" Value=";#XXXPublishingNews;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390066034fe9c0e14ea1aa04c334979ebf430050ae6dbc3b1a45e5ac1bfedc1269e250;#" />
  <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
  <Property Name="Title" Value="XXXNewsArticle" />
</File>

Does anyone have any tips, pointers or ideas?

closed as off-topic by Benny Skogberg Mar 20 at 8:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • How do you embed the webpart? – Robert Lindgren Jul 10 '13 at 9:52
  • Have you tried this approach? zeemanj.net/2012/02/… – Robert Lindgren Jul 10 '13 at 9:55
  • Apologies, I should clarify. I attempted to insert the Webpart onto the page using the standard Ribbon bar and editing interface. I want users to be able to insert webparts whenever they wish. Have edited my initial question. – zedmeister Jul 10 '13 at 12:14
0

I faced the kind of similar issue today, the problem was in the Custom page layout.. I was using <SharePointWebControls:FieldValue to render the HTML field..

I replaced it with <PublishingWebControls:RichHtmlField and the Web Parts started showing on the page.

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