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

In SharePoint 2010, when I add an RichHtmlField in my custom Page Layout, the control's display in edit mode doesn't have any of the "chrome" around it that a stck page layout does. In fact, the is no indication that the control is even on the page until you put your curson in it.

Here is what i mean:

enter image description here

What am I doing wrong? What attributes or containing control do I have to add to make the editing experience a little more friendly?

share|improve this question
add comment

1 Answer

Please have the following steps closely followed to create a custom richtext control inside your page layout and have it display with chrome.

Create a custom content type
a) Go to site settings > Galleries > Site Content Types > Create > followed by the screenshot as mentioned below

enter image description here

Save the content type and you will be redirected to the newly created content type modification page. Scroll below and you will the see option "Add from new site column". Click on that and create a custom site column . Please follow the screenshot below :- enter image description here

Page Layout
Then create your page layout (site settings > galleries> masterpage and page layouts) using the newly created custom content type. Refer to the screenshot below enter image description here

Now edit this page layout in SharePoint designer and drag the publishing column from the toolbox > SharePoint Controls > Content Fields as shown in the below screenshot.

enter image description here

Once dragged in the required region of the page (generally inside a div or a table) you will a markup generated by SharePoint something like this :-
<PublishingWebControls:RichHtmlField FieldName="6946f02c-c941-452e-be99-14126eb266ef" runat="server"></PublishingWebControls:RichHtmlField>
Now modify this to give it a field name so that it appears during the edit page mode.

<PublishingWebControls:RichHtmlField InputFieldLabel="centercontentbox" FieldName="6946f02c-c941-452e-be99-14126eb266ef" runat="server"></PublishingWebControls:RichHtmlField>

Save the page layout.

Pages Document Library (assuming you have publishing feature activated)
Go to the document library where your landing page or the page where you want the rich text content to come. This is generally Pages library or Site Pages Library. Go to library settings and add from existing content type to this library as shown below

enter image description here

Final step involves in creating a page inside this library using this content type.
enter image description here

Once you have selected this content type , just selected associate page layout for this page as "mypagelayout.aspx".

Now you will have the richtextbox control come up with a name "Centercontentbox" with chrome surrounding it. All it needs is no messed up RTE or editmode css included within the masterpage.

share|improve this answer
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.