This is a migrated thread and some comments may be shown as answers.

Image url overwritten when reposition it

2 Answers 102 Views
Editor
This is a migrated thread and some comments may be shown as answers.
AM
Top achievements
Rank 1
AM asked on 12 Feb 2009, 05:05 PM
Hi,

In the RadEditor, I used Image Manager to upload an image and then added it to the Editor. But if I move the image to a new position, the relative url image path get rewritten to the absolute url (<IMG alt="" src="/MyProject/content/Images/$2_Bill_Concert.jpg"> ===> <IMG alt="" src="http://localhost/MyProject/content/Images/$2_Bill_Concert.jpg"> ). I tried using "

HtmlContent.ContentFilters =

EditorFilters.None;" and also 

 

"StripAbsoluteImagesPaths

 

="true". None of those seemed work. Is there any other way to fix this. I want the image url to stay relative.

Thanks in adavnce for your help.
AM

 

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 16 Feb 2009, 04:43 PM
Hi AM,

We are aware of this behavior and the problem is inherent to IE - during drag & drop it automatically converts all links to absolute.

To workaround the problem we implemented a new content filter named StripPathsFilter. The content filter will allow the developer to specify an array of strings that will be stripped from the absolute path and make it relative. Here is an example demonstrating how to configure the filter and strip the http://localhost/EditorFixes/ string from the absolute path:


<script type="text/javascript"
function onclientload(editor) 
     editor.get_filtersManager().add(new Telerik.Web.UI.Editor.StripPathsFilter(["http://localhost","/EditorFixes/"])); 
</script> 
<rad:RadEditor ID="radEdit" runat="server" OnClientLoad="onclientload"

The Telerik.Web.UI.Editor.StripPathsFilter method receives as a parameter an array of strings that will be stripped from the absolute links.

Best regards,
Rumen
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.
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 18 Dec 2009, 07:50 AM
Works perfect!

Marc
Tags
Editor
Asked by
AM
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or