Question on Paragraphs

7 posts, 0 answers
  1. mats
    mats avatar
    4 posts
    Member since:
    Oct 2008

    Posted 24 Apr 2009 Link to this post


    Hi there,

    Does the new 2009 Q1 release for MOSS Rad Editor supports to disable filter like FixEnclosingP. In following article http://www.telerik.com/community/forums/aspnet/editor/question-on-paragraphs.aspx the RadEditor Classic only have this functionallity.

    Thank you
  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 28 Apr 2009 Link to this post

    Hello mats,

    In order to disable the FixEnclosingP content filter in RadEditor for MOSS 5.x.x, you need to modify the respective ConfigFile.xml or ListConfigFile.xml (for forms scenarios), which are located in the Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.4.0.0__1f131a624888eeed\Resources folder. Just add the following code.
    <property name="ContentFilters">RemoveScripts,MakeUrlsAbsolute,FixUlBoldItalic,IECleanAnchors,MozEmStrong,ConvertFontToSpan,ConvertToXhtml,IndentHTMLContent</property> 

    If you want to disable other content filters just remove them from the list, which is value of the ContentFilter property element.

    I hope this helps.


    Regards,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

  3. mats
    mats avatar
    4 posts
    Member since:
    Oct 2008

    Posted 28 Apr 2009 Link to this post

    Thanks works perfect! // Mats
  4. David Slot
    David Slot avatar
    5 posts
    Member since:
    Sep 2009

    Posted 04 Sep 2009 Link to this post

    Hi Stanimir,

    I'm using v 4.5.6.0 of the Moss rad editor control.
    When I add the ContentFilters property to my ConfigFile.xml, I get the following server error:
    "Configuration File provided is not valid. Invalid entries: ContentFilters"

    Is there any other way to disable the FixEnclosingP filter?

    Thanks in advance.

    Greetings,

    David
  5. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 07 Sep 2009 Link to this post

    Hi David,

    The version of RadEditor for MOSS that you are using (4.5.6) is based on the classic ASP.NET RadEditor. In this version there is no FixEnclosingP filter implemented and the ConentFilters property is not available as well. Could you please explain what is the behavior that you are trying to achieve?

    Thank you.

    Best wishes,
    Stanimir
    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.
  6. David Slot
    David Slot avatar
    5 posts
    Member since:
    Sep 2009

    Posted 10 Sep 2009 Link to this post

    Hi Stanimir,

    What I actually want to achieve is that the text in the editor will always be surrounded by <p> tags, even when I'm writing only one line.
    With the current (default) settings of the editor, even when I manually surround my line with <p> tags, the tags will be stripped out when saving the page.

    Is there any way to achieve such behaviour?

    Thanks in advance.

    Greetings,

    David
  7. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 11 Sep 2009 Link to this post

    Hi David Slot,

    Please review the following forum thread http://www.telerik.com/community/forums/aspnet/editor/paragraphs-breaks.aspx.

    In your case what you need to do is add the following code to the ConfigFile.xml or ListConfigFile.xml, which are located in the Program Files/Common Files/Microsoft Shared/web server extensions/wpresources/RadEditorSharePoint/4.x.x.x__1f131a624888eeed/RadControls/Editor folder.
    <property name="OnClientInit">OnClientInit</property> 

    Then make sure that you have the following javascript function loaded in the page. For example you could place in the master page by using the SharePoint Designer.
    <script>    
    function OnClientInit(editor)    
    {    
        oldFun = editor.GetHtml;    
            
        editor.GetHtml = function(runFilters)    
        {       
            if (editor.GetMode() != 1) return oldFun.call(editor, runFilters);    
                            
            //Check if a P tag exists that "wraps" all content    
            var contentArea = editor.GetContentArea();                      
            var wrapper = false;    
                
            if (contentArea.firstChild    
                && ("P" == contentArea.firstChild.tagName)    
                && (contentArea.childNodes.length == 1)    
                && (contentArea.innerHTML.substring(0,3).toLowerCase() == "<p>")    
            )    
            {    
                wrapper = true;    
            }    
                    
            var html = oldFun.call(editor, runFilters);    
            //alert(wrapper + " Current html! + " + html);                  
            if (wrapper)    
            {    
                html = "<p>" + html + "</p>";    
            }    
                
            return html;    
        }                                       
    }    
    </script>    
     

    I hope this helps.


    Greetings,
    Stanimir
    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.
Back to Top