+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / RadEditor FireFox Issue

RadEditor FireFox Issue

4 posts, 0 answered
  1. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    10 Jan 2008
    Link to this post
    We came across an issue where we have placed some code in an editor for a generic content item. The links are set using relative paths. The problem occurs when in Firefox if you copy the code in the design mode of RadEditor and try to paste into a new generic content item's RadEditor, also in design mode, the paths are changed. We used a leading "/" to specify the root of the site. When pasting the html copied from the RadEditor, the links are now changed to "../../" to get to the root of the site.

    This will cause the site to through and error when trying to render the content of the RadEditor to an ITextControl. Since these are not absolute paths, RadEditor does not strip them upon submitting. I tried to specify the "../../" in the AnchorPathToStrip and the ImagePathToStrip to see if it would remove it but no luck.
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    11 Jan 2008
    Link to this post
    Hi Richard,

    As a workaround of the problem, you could implement in the EditorTemplate.ascx template, a javascript function that strips the instances of ../ in the image (anchor) paths on submit.
    The EditorTemplate.ascx file is located in \[Your Project]\Sitefinity\Admin\ControlTemplates\Generic_Content folder. Here is a possible scenario to achieve this:

    1. Get all elements by tag name - "IMG" or "A".
    2. Iterate through an array of all elements.
    3. Get the corresponding attribute ("src" or "href") for each element in the array.
    4. Make the necessary replacements in the attribute value.
    5. Set the attribute with the new value.

    Here is a reference to the RadEditor online help. The most important for you is "Client-side API Reference"
    chapter that discusses how to get a reference to the editor and its Document object as well as client-side methods and events.

    Also please, read the following article and make sure that you have set image and anchor paths stripping properly.

    Hope this is helpful for you.

    Sincerely yours,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    11 Jan 2008
    Link to this post
    Thanks for the information Pepi.

    Is this something that might be addressed from the RadEditor side in a later release? I know the different browsers return different paths to objects when it comes to url's and I can see this being an issue when someone wants to copy text from another site and paste it into an editor. 
  4. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    11 Jan 2008
    Link to this post
    Hi Richard,

    Our RadEditor team has been notified about this issue and it is already in their ToDo list for future releases.

    All the best,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
4 posts, 0 answered