Problem using RadHtmlField in MOSS-PageLayout with custom ImageManager

3 posts, 0 answers
  1. Ricky Mattischeck
    Ricky Mattischeck avatar
    12 posts
    Member since:
    Oct 2009

    Posted 21 Oct 2009 Link to this post

    Hi there,

    I try to use the RADEditor in a SharePoint PageLayout as a substiture for the PublishingWebControls:RichHtmlField.

    First I tried to use telerik:RadHtmlField instead of the default MOSS-Tag. But I want to set my own, individual (dynamical) paths for the Editor's ImageManager, DocumentManager, etc. so I can't use the config-file. As a matter of this, I created my own class which has Telerik.SharePoint.FieldEditor.RadHtmlField as base-class and a public method that returns the radEditorControl:

        public class SLRADHtmlField : Telerik.SharePoint.FieldEditor.RadHtmlField 
            public MOSSRadEditor GetMOSSRADEditorControl() 
                return radEditorControl; 

    Now I can replace <telerik:RadHtmlField id="..." FieldName="Resolution".../> by my own tag <sl:SLRadHtmlField id="..." FieldName="Resolution".../>

    In the overridden OnLoadComplete-Method in my CodeBehind-Class now I have access to the RadEditor-Control by using the following code:

    MOSSRadEditor RadEditor = SLRADHtmlField.GetMOSSRADEditorControl(); 

    After this, I can modify ImageManager-settings and so on...

    First trying seemed to be successful, the entered text was saved after submitting. So I tried some little more like formatting in bold, italic, underline. That was successfully too.. partial. The underline-style was not saved. After that, I tried to insert an image. Adding the image to the editor-field was successful too but after saving, the image was gone.

    I had a look to the html-tab in the editor and both, the <span>-tag for the underlining and the <img>-tag were removed.
    After a lot of googling and reading other threads in this forum, I found this page about contentfilters. Now I added this line to my code:

    RadEditor.ContentFilters = EditorFilters.None; 

    It prevents that the underline-tag is stored as <span> but remains as <u>-tag.
    This solved the problem with the disappearing underline but not with the disappearing <img>-tag.

    It seems that some special tags (like <span> or <img>) are stripped out completely but I haven't looked yet which other tags are also removed.

    Meanwhile I don't have any ideas no more...

    Could you please give me some guidance?

    I installed the radeditormoss.wsp and added references in my Visual Studio project to the RadEditorSharePoint.dll Version and because of that to the Telerik.Web.UI.dll Version 2009.2.826.20.

    Greetings from Germany,
    Ricky Mattischeck
  2. Stanimir
    Stanimir avatar
    1654 posts

    Posted 22 Oct 2009 Link to this post

    Hi Ricky,

    Please send us sample with HTMlL code, which is stripped on save and I will run some tests on our test server. How ever what you should know is that you can see the code that is send to the server, when you are in Html mode of the RadEditor. When you set the Editor's ContentFilters to None there are no modifications of the code done by the RadEditor.

    Keep in mind that this might be yet another problem, caused by the MOSS content filter. When you submit the page, MOSS will validate it and automatically make changes if the content is not valid. You can verify this by trying to enter the same content with the original SharePoint rich text editor.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Ricky Mattischeck
    Ricky Mattischeck avatar
    12 posts
    Member since:
    Oct 2009

    Posted 22 Oct 2009 Link to this post

    Hi Stanimir,

    nevermind, I found the reason for this behaviour.

    After a lot of digging and comparing between created page-layout-aspx-file, fields and contenttypes created by me in xml and created by ui, I discovered, that the setting for the RichTextMode-attribute in the column of my contenttype attached to the pages-list is "Compatible" but in the field directly added to the site collection it is set to "FullHTML". This was my mistake! The correctly written value has to be "FullHtml" (small letters). So while programmatically attaching the conttenttype to the pages-list sharepoint couldn't recognize the value "FullHTML" in the SPRichTextMode-enumeration and sets the default-value which is "Compatible".

    Now everything works like a charm.

    Ricky Mattischeck
Back to Top