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

[Solved] Adjusting ViewPaths

1 Answer 105 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Alex Dybenko
Top achievements
Rank 2
Alex Dybenko asked on 04 May 2009, 04:57 PM
Hi,
i am using Image manager to add pictures to editor content, ViewPaths is set as ~/MyImages, so when picture is inserted - path becomes /MyApp/MyImages/MyPic.jpg. But on production server a virtual folder can be different, or just root, so i would like to have pictures inserted like MyImages/MyPic.jpg. Is there a simple way to do so? Of course i can make replacement in code, but perhaps there is some property, which i do not see
Thanks
Alex

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 07 May 2009, 05:04 AM
Hi Alex,

You can attach the function below to the OnClientLoad event property of RadEditor and strip the desired part of the links / images paths:

<script type="text/javascript">
function editorClientLoad(sender,args)
{
   var pathsToStrip = ["http://server","https://server"];

   sender.get_filtersManager().add(new Telerik.Web.UI.Editor.StripPathsFilter(pathsToStrip));
}
</script>
 <telerik:radeditor runat="server" ID="RadEditor1" OnClientLoad="editorClientLoad"></telerik:radeditor>

where "server" is the address of your site. You can list as many URLs as you like in the pathsToStrip array. The behavior is similar to the ImagesPathToStrip and AnchorPathToStrip properties described in the KB article: Stripping image and anchor paths in RadEditor.

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.
Tags
Editor
Asked by
Alex Dybenko
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Share this question
or