10/جمادى الأولى/1432 09:20 ص
I have several custom columns of type "Publishing HTML", and a page layout several controls which point to the columns. :
<SharePointWebControls:RichTextField DisableInputFieldLabel="True" FieldName="WheelImage" runat="server"></SharePointWebControls:RichTextField>
The problem is that in the end result, the page shows escaped HTML (eg. <p></p>) rather than the rendered output I would expect.
Oddly - when it edit mode - they render fine, showing the rendered output. But in the 'reader' view, it shows the raw HTML.
I have also checked the 'edit html source' in edit mode - and it looks fine, like HTML. But the browser source of the output page shows escaped html: <br/>
I found this describing the same problem, but its not a solution - as this happens on any browser:
Anyone any ideas?
10/جمادى الأولى/1432 09:37 ص
I have used the U2U CAML Query builder software to query what is actually being stored - and it is html tags as you would expect:
But at the front end, this is being sent to the browser as:
But oddly - not on "edit mode" - where it displays as normal.
10/جمادى الأولى/1432 10:24 ص
I think I got it.
When setting up this site - I had added the columns directly to the site, and not to the content type at the root of the site.
When I add tyhe colums to a custom content type - and then add that content type to the site (rather than the individual columns) - it works.
I have no idea why this would result in it rendering encoded HTML, but it seems to have that effect.
- تم وضع علامة كإجابة بواسطة MikebEdwards 10/جمادى الأولى/1432 10:50 ص
20/رجب/1432 07:53 ص
I know, I got it.. ;)
This morning I ran into the same problem. The solution is as follows:
Do not use Multiple Lines of Text for the site column and also do not use <SharePointWebControls:RichTextField> in the page layout, because the Ribbon is not activated for formatting. These settings are more MOSS2007 like.
What should you use?
For the Site Column : Publishing HTML (Full HTML content with formatting and constraints for publishing)
For the Page Layout: <PublishingWebControls:RichHtmlField>
- تم الاقتراح كإجابة بواسطة Octavie 20/رجب/1432 08:33 ص
04/رمضان/1432 07:16 م
Does not work for me.. I still see encoded text.
I have Page Content 2 and Page Content 3 as site columns(Publishing HTML) and they are added to page layout(PublishingWebControls:RichHtmlField). Worked on 2007 but when I moved to 2010 started having problems...
16/ربيع الثاني/1433 11:22 م
Hey Mike I am having this exact problem but I do not follow your solution? Do you mean you manually added columns to the site via Sharepoint Designer or something? In my case I created a custome Page layout with html controls like this
I then created a Custom Content type with fields like this
fields I then added them to my site via my WSP. But whenever I create a new page and assign it's pagelayout to be my custom one I still get your situation where it looks good in edit mode but it is escaped as text in the reader view. From what you said and I've read other places I am not seeing what I am missing. Can you help?
13/جمادى الأولى/1433 11:01 م
I had a similar experience as you; I had multiple RichHtmlFields on my page, and one was displaying correctly while another was not. When I viewed the fields via the powershell, I noticed a difference in the SchemaXML, the WORKING field had the following additional properties:
I wrote a quick script to update the problem field, and the problem went away for me (look below for script). The change has to be made at the list level for it to take affect on existing pages/lists, but I believe making the modification to the column at the root web (or correct subweb) would work as well.
$web = $site.OpenWeb($site.RootWeb.ID)
$list = $web.Lists["Pages"]
[Microsoft.SharePoint.Publishing.Fields.HtmlField]$field = [Microsoft.SharePoint.Publishing.Fields.HtmlField]$list.Fields.GetFieldByInternalName("Abst ract")
$field.RichText = $true
$field.RichTextMode = [Microsoft.SharePoint.SPRichTextMode]::FullHtml
You may want to check your field to make sure those properties are set. Hope that helps!
- تم الاقتراح كإجابة بواسطة Pawan Upadhyay 20/جمادى الثانية/1433 12:47 م
20/جمادى الثانية/1433 12:48 م
Thanks Kevin...! Your solution works for me.
08/ذو الحجة/1433 07:36 صThx for this post. This works for me! Keep up the good work!!