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 a custom page layout created, in which "PublishingWebControls:RichHtmlField" control is added with some default HTML value.

When any page is created using the custom page layout created, page does not include value of RichHtmlField. But if I click "Edit Page", I can see RichHtmlField content in Edit Mode, now if I checkin the page then page will display RichHtmlField content even in View Mode also.

PS: I am creating publishing page programmatically using custom page layout, but even I try creating new publishing page manually then also RichHtmlField content is not available in page.

Please let me know if you need any more clarification.

Any help would be appreciated.

Thanks.

share|improve this question
2  
Could you show us the code you use to add the RichHtmlField? Thanks. –  Norbert Dec 4 '12 at 15:02
3  
Show us your markup. I suspect you have your Field within a EditMode Panel. Is that it? –  Fox Dec 19 '12 at 7:52

5 Answers 5

You should create bindings to your custom content type: create empty element, add bindings like this to your element file:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!--Default content type-->
  <ContentTypeBinding ContentTypeId="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390058B401C214E6459BA1DA5B70C350C721" ListUrl="$Resources:osrvcore,List_Pages_UrlName;" />
</Elements>

Once file is created - add element file to new feature. Update the package and activate your feature. It should work now...

Hope it helps

share|improve this answer
    
Huh?? That makes no sense. Please elaborate on how you get to that answer if you dont mind. –  Fox Jan 29 '13 at 14:06

This works fine for us:

<PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" runat="server" PopupEditorMode="True"/>

Allows editing and displays content.

share|improve this answer

So what's propably happened is that you've got the HTMLField within your EditMode Panel as below

    <PublishingWebControls:EditModePanel>
                          <PublishingWebControls:RichHtmlField id="PageContent" FieldName="PublishingPageContent" runat="server" CssClass="bp-pagelayout-contenttable-maxwidth"/>
    </PublishingWebControls:EditModePanel>

but not in PlaceHolderMain. Post your markup you used for the page layout so we can have a look.

share|improve this answer

Did you create a new content type for your page layout? The "PublishingWebControls:RichHtmlField" control is always associated with a field in your related content type with a data type of PublishingHTML. You will need to get the guid of the new field and associate it with the RichHtmlField in the page layout markup before it will show the content of the page:

<PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" HasInitialFocus="True" MinimumEditHeight="400px" runat="server"/>

Here PublishinPageContent is the content type field related to an OOTB page layout. Each RichHTMLField has to be related to a field for it to display the content as expected. If you added a new RichHTMLField control then perhaps you didn't include a field for it in the related content type (or didn't create a new content type at all).

Hope that helps.

share|improve this answer

Try adding the html element works for me.

    <PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" runat="server"     PopupEditorMode="True" html="<span><p>This will be displayed on every page you create</p></span>" />
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.