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

How to impelment image URL replacement?

3 Answers 155 Views
Editor
This is a migrated thread and some comments may be shown as answers.
miksh
Top achievements
Rank 1
Iron
miksh asked on 08 May 2015, 01:37 PM

Hello, 

 We have a dedicated content website, e.g. http://conent.mysite.com so all shared content (images, documents, media etc.) uploaded via radEditor should have an absolute link to this site. At the same time in order to upload files in radEdior we must add this shared location as a virtual folder, e.g. http://admin.mysite.com/content.

Then href to such items used in radEditor could be either:

How can we ​apply MakeUrlsAbsolute filter but pointing to another root, i.e. to  http://conent.mysite.com/img.png

 

 

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 11 May 2015, 12:07 PM
Hi miksh,

RadEditor does not provide the described functionality out-of-the-box, but still there are two possible ways to achieve the desired behavior depending on the moment that the filtering will be applied:

When switching between Design/Html mode or submitting the form
You can create a custom content filrer where to replace the actual (admin) domain name with the target one. A similar approach is demonstrated in the following KB article for link elements, so you can use it as a base for your custom filter implementation: How to produce relative path for links when MakeUrlsAbsolute content filter enabled

While inserting the image from the ImageManager
You can handle the Editor's onClientPasteHtml event and modify the image's source attribute just before the image it is inserted. More details are available here: http://www.telerik.com/help/aspnet-ajax/editor-onclientpastehtml.html

I hope this helps.

Regards,
Vessy
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
miksh
Top achievements
Rank 1
Iron
answered on 12 May 2015, 01:33 PM
Very helpful, thanks a lot!
0
Vessy
Telerik team
answered on 12 May 2015, 03:10 PM
Hi miksh,

I am glad the provided information was helpful for you. Feel free to contact us again should we can be of any further assistance.

Regards,
Vessy
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Editor
Asked by
miksh
Top achievements
Rank 1
Iron
Answers by
Vessy
Telerik team
miksh
Top achievements
Rank 1
Iron
Share this question
or