How to impelment image URL replacement?

4 posts, 0 answers
  1. miksh
    miksh avatar
    275 posts
    Member since:
    Nov 2006

    Posted 08 May 2015 Link to this post

    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

     

     

  2. Vessy
    Admin
    Vessy avatar
    1384 posts

    Posted 11 May 2015 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. miksh
    miksh avatar
    275 posts
    Member since:
    Nov 2006

    Posted 12 May 2015 in reply to Vessy Link to this post

    Very helpful, thanks a lot!
  5. Vessy
    Admin
    Vessy avatar
    1384 posts

    Posted 12 May 2015 Link to this post

    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.

     
Back to Top