Stripping domain name from Urls

2 posts, 0 answers
  1. ajd
    ajd avatar
    8 posts
    Member since:
    Nov 2008

    Posted 24 Jun 2009 Link to this post

    I am using the fully featured RadEditor for MOSS - version

    When I use the editor in a WCM scenario the domain name of Urls are stripped. For example, becomes /Pages/default.aspx This is exactly what I want and what I would expect.

    However, when I use the editor as a web part as described here

    the Url's do not get stripped.

    I am not using the Link manager, I am inserting Reusable Content and the reusable content html does not have absolute Url's in the source. The domain name gets attached once it is inserted in the web part. Typing an anchor tag in manually produces the same result - no stripping.

    I have these properties set in my Config and ListConfig files.

    <property name="StripAbsoluteImagesPaths">true</property>
    <property name="StripAbsoluteAnchorPaths">true</property>

     Is there a way around this?

  2. Stanimir
    Stanimir avatar
    1654 posts

    Posted 24 Jun 2009 Link to this post

    Hi ajd,
    StripAbsoluteImagesPaths and StripAbsoluteAnchorPaths are obsolete. In order to achieve the desired functionality you need to create your own custom content filter for the RadEditor for MOSS.

    Here is an example of how to do this.
    1. You should use the OnClientLoad property of the RadEditor to attach a handler. To do this you should add the following line in the ConfigFile.xml or ListConfigFile.xml, which are located in the \Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\\Resources folder.
    <property name="OnClientLoad">OnClientLoad</property>  

    2. You can use MOSSEditorTools.js to add custom java script code to RadEditor. There you should define the OnClientLoad handler and your custom content filter.
    Here is an example that you may find useful:
    function OnClientLoad(editor, args)  
        editor.get_filtersManager().add(new MyFilter());  
    MyFilter = function()  
        this.set_name("RadEditor filter");  
        this.set_description("RadEditor filter description");  
    MyFilter.prototype =  
        getHtmlContent : function(content)  
            var newContent = content;  
            //here you replace absolute URL 
            newContent = newContent.replace(/http:\/\/\//g, "");  
            return newContent;  
        getDesignContent : function(content)  
            var newContent = content;  
            return newContent;  
    MyFilter.registerClass('MyFilter', Telerik.Web.UI.Editor.Filter);

    Just add this code in the end of MOSSEditorTools.js, which is located in the mentioned above folder .

    Once you follow these steps, the absolute part of the URL should be stripped.

    I hope this helps.

    All the best,
    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.
Back to Top