RadEditor Image Manager - force full web image path

7 posts, 0 answers
  1. John M
    John M avatar
    14 posts
    Member since:
    Aug 2009

    Posted 16 Jan 2012 Link to this post

    In my site we allow users to create html emails.  We create HTML templates that users edit using the RadEditor.  Afterwards they download the edited HTML and send the email using their own system.  The problem I'm having is with the Image Manager.  A user will upload an image and insert into the HTML but when they download the HTML the image no longer works.  Looking at the HTML that was generated, the image path is relative which is why it doesn't work.  My question is, is there a way to use a URL instead of a relative file path?

    Thanks!
  2. Kaushal
    Kaushal avatar
    47 posts
    Member since:
    Sep 2010

    Posted 17 Jan 2012 Link to this post

    Hi John,

    Why don't you save this image at some temporary location by generating GUID for each image before sending the email! Now when user will receive the mail he/she will get html with that folder path of that image named GUID. I think that will be the better way.

    Thanks,

    Kaushal Jani
  3. John M
    John M avatar
    14 posts
    Member since:
    Aug 2009

    Posted 17 Jan 2012 Link to this post

    Kaushal,

    Thanks you for the reply.  I do use guid-named images when I generated the HTML.  The issue is what to do when a user uploads their own image using the Image Manager inside of the RadEditor control.  It is the Image Manager control that gives images a relative path when they are inserted into the HTML.  I need to know how to force it to give a complete URL instead of just a relative path.

    Thanks,

    John
  4. Rumen
    Admin
    Rumen avatar
    14324 posts

    Posted 18 Jan 2012 Link to this post

    Hello,

    You should enable the MakeUrlsAbsolute filter of RadEditor, e.g.

    ContentFilters="DefaultFilters,MakeUrlsAbsolute"

    or

    RadEditor1.EnableFilter(Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute);

    It will make all src attributes in the editor content to have absolute URLs. You can test the MakeUrlsAbsolute filter in the Built-in Content Filters demo.

    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  5. John M
    John M avatar
    14 posts
    Member since:
    Aug 2009

    Posted 18 Jan 2012 Link to this post

    That did the trick, Thanks!
  6. Giancarlo
    Giancarlo avatar
    1 posts
    Member since:
    Dec 2012

    Posted 06 Nov 2013 Link to this post

    I want to change only image src to absolute path.

    There is some method to force absolute path for only image source and not for href source?

    best regards
  7. Ianko
    Admin
    Ianko avatar
    1934 posts

    Posted 08 Nov 2013 Link to this post

    Hello Giancarlo,

    I have answered you to this question in you opened support thread. Please, let us continue the conversation from there.

    For anybody interested on this subject, the desired functionality could be achieved by implementing a custom content filter, which does the logic to preserve or convert the src and href attributes with the desired logic. 

    Regards,
    Ianko
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top