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

[Solved] StripAbsoluteImagesPaths?

19 Answers 585 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Paul Hopper
Top achievements
Rank 1
Paul Hopper asked on 28 Nov 2007, 01:42 AM
The non-Prometheus version of the Editor has a property StripAbsoluteImagesPaths that, when set to false, causes the editor to use the full URL for the image.  This was a very valuable feature, but I can't find any mention of it in the forums or documentation.  Is there a counterpart in the Prometheus version that I'm overlooking?  If not, I cast my vote for porting that feature over to the Prometheus Editor.  Does anyone have a workaround that accomplishes the same thing... perhaps a regular expression-based search and replace?

19 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 29 Nov 2007, 03:42 PM
Hi Paul,

RadEditor Prometheus features a new URL preserving mechanism that is able to keep links and src the way they are originally entered. That is relative URLs stay relative, absolute stay absolute.

However, it is of course preferable to be able to control this with a single easy setting so that users can simply edit content without having to consider these details.

We plan to add a similar property to RadEditor Prometheus for the Q3 release coming Dec.17 in order to handle scenarios such as yours.

For the time being we suggest to use the content filter that does the same job - and is attached to this answer.

Additional information on implementing content filters can be found in this online demo:
http://www.telerik.com/demos/aspnet/prometheus/Editor/Examples/ContentFilters/DefaultCS.aspx


Kind regards,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Runi Thomsen
Top achievements
Rank 1
answered on 11 Dec 2007, 12:46 PM
Good awnser :-)

But is it possible to force the ImageMananger to enter absolute URL's when inserting a picture, and thus keep the new URL preserving mechanism while making the mananger inserting absolute URLs only ?
0
Tervel
Telerik team
answered on 12 Dec 2007, 05:01 PM
Hi Paul,

The logic behind the editor is that all URLs inserted with the editor should be treated in a uniform and predictable manner. That is - the same way. Thus, the answer to your question is: no, it is not possible as there will likely be undesired side effects and problems.

However, with some lines of code it will be possible to implement such a custom scenario soon -
because the ImageManager and the LinkManager use the editor's pasteHtml function to insert content. We plan to provide a client event called OnClientHtmlInsert which will allow the developer to process the content to be inserted and make changes to it.

Thus, you will be able to detect that an image is about to be inserted, and change its URL to absolute path.
This client event will not appear in the Q3 Proemtheus release scheduled for next week, but it is on our TODO for the Q1 2008.

Greetings,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Lini
Telerik team
answered on 17 Jan 2008, 05:12 PM
Hi,

One of our customers has reported a small bug with the filter - links with quotes in the URLs are not handled correctly. I am attaching an updated version of the filter, where this bug has been fixed.

Greetings,
Lini
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Scott Smith
Top achievements
Rank 1
answered on 10 Feb 2008, 09:42 PM
Hi,

In the second post, by Tervel, he indicated that the Q3 release would contain something like the StripAbsoluteImagePaths setting found in the non-Prometheus Editor.  Was that implemented?  If so, what is the setting?

Thanks.

Scott
0
Rumen
Telerik team
answered on 11 Feb 2008, 08:40 AM
Hi Scott,

The requested StripAbsoluteImagePaths and StripAbsoluteLinkPaths properties were not included in the latest release of RadEditor "Prometheus" because we are always trying to keep the editor's properties as much small as we can. A large number of properties will make the control configuration very difficult.

We prefer to provide pluggable filters (like EditorAbsoluteLinksFilter_20080117.zip) that can replace the implementation of new properties. We hesitate whether to include or not the StripAbsoluteImagePaths and StripAbsoluteLinkPaths properties in RadEditor "Prometheus" and we will implement them or not depending on the feedback received by our clients.


Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
rdochert
Top achievements
Rank 1
answered on 19 Feb 2008, 10:30 AM
i'm also having a problem with this filter. using IE7, i insert an image and the absolute URL is correctly configured. i then click on the image and click the hyperlink tool to create a hyperlink.

so far so good.

as a user, i now see an ugly border around my image which the hyperlink has caused (as an aside, can we have the image border default to 0?) so i right-click on the image and choose image properties. i set the border on the popup to 0 and save. the IMG tag has now mysteriously moved outside of the <A tag.

any ideas?


personally, i'm not a big fan of this implementation at all. i can understand the need to keep a lid on the built-in functionality ... but i do think this particular function is pretty fundamental. i would guess that lots of people would be using Editor in a multi-user content management system of some sort. In those scenarios, the relative path to the image will rarely be adequate.

i hope Telerik are able to reconsider this stance at some point. in the meantime, it would just be great to get the filter working ok.

sincerely,
rob
0
George
Telerik team
answered on 20 Feb 2008, 02:19 PM
Hi Rob,

I tried to reproduce the issue but to not avail.

Could you, please, open a support ticket and send us a sample project, in which the problem can be observed, along with some screenshots.  We will do our best to provide you with a solution immediately.

For convenience I attached a video which shows the test I've made.

Kind regards,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
christopher willis
Top achievements
Rank 1
answered on 26 Feb 2008, 12:55 PM

Could you perhaps put some server side helper functions to assist with this?

Personally, I need to either convert all urls to absolute, or all to relative before I save the content.  Absolute URL's are a must if you are editing emails or RSS blog type stuff.

Somthing like:

mycontent  = editor1.ConvertUrls(editor1.content, enumToAbsolute, https://www.mydomain.com)




mycontent  = editor1.ConvertUrls(editor1.content, enumToRelative, https://www.mydomain.com)
0
AlphaVegas
Top achievements
Rank 2
answered on 26 Feb 2008, 03:40 PM
I am also having a problem with this implementation. It has been stated that the Prometheus Editor "is able to preserve links exactly as entered"
http://www.telerik.com/community/forums/thread/b311D-bbabab.aspx


When I insert an image into the Editor the relative path(that I require) is correctly inserted. However, as soon as the image is dragged by the User into another element(e.g. html table) the absolute path is assigned to the image.


Regards,
A.
0
rdochert
Top achievements
Rank 1
answered on 26 Feb 2008, 07:51 PM
i'm sorry to jump on the bandwagon on this. you guys do a fantastic job with your toolset and your responsiveness to developers is amazing. but, sorry, this time i think you have this wrong. the absolute v relative urls is not an "add on" issue in my opinion. i really think it is fundamental to the way the editor works and the current implementation will leave many developers dissatisfied and shoehorn-ing tons of difficult to maintain JS into their pages to try to make it work. the non-prometheus editor had the implementation about right.

just my 2c worth.
rob
0
Scott Smith
Top achievements
Rank 1
answered on 26 Feb 2008, 08:01 PM
For what it is worth, I think this should be a built in feature.  It was a pain to implement in the 15 or so instances of the editor I use.

Scott
0
George
Telerik team
answered on 27 Feb 2008, 05:28 PM
Hi,

I am glad to inform you that we have included in our ToDo list the requested StripAbsoluteImagesPaths functionality - we will do our best to implement it for the upcoming Q1 release of RadEditor for "Prometheus".

Regarding the "relative path change when moving image, which is a  link, into a table cell", the observed behavior is an IE bug and can be reproduced in any other web based editor. Unfortunately it is not possible to determine the link image's movement into the table's cell.



Kind regards,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
rdochert
Top achievements
Rank 1
answered on 27 Feb 2008, 06:45 PM
Outstanding!.
rob
0
Nick
Top achievements
Rank 1
answered on 08 Apr 2008, 03:02 PM
Hi,

I used the filter as used in the zip file that you sent me and it works great.
We did have a problem however when we attempted to get this working in our live project where we have the editor in a <asp:wizard> inside an <asp:UpdatePanel>. We can't seem to get that javascript working in there.

Is there anyone else who had that problem and found a solution for it?

Thanks,
Nick.
0
Rumen
Telerik team
answered on 08 Apr 2008, 03:40 PM
Hi Nick,

In the latest Futures build of RadControls "Prometheus", we added a new property - ContentFilters. It allows the developer to set which content filters will be active when the editor loads. If you want to produce links / images with absolute paths, set this property to MakeUrlsAbsolute: this filter makes all URLs in the editor content absolute (e.g. "http://server/page.html" instead of "page.html").

RadEditor1.ContentFilters =  Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute;

Since this filter is DISABLED by default, RadEditor produces relative href / src paths until disabling the
MakeUrlsAbsolute property.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Nick
Top achievements
Rank 1
answered on 08 Apr 2008, 04:13 PM
Hi,

Thanks for the quick response.
It worked perfecty.

Thanks.
Nick.
0
Nick
Top achievements
Rank 1
answered on 09 Apr 2008, 09:56 AM
Hi,

After a closer look to the RadEditor and the 

RadEditor1.ContentFilters =

EditorFilters.MakeUrlsAbsolute;

that you posted yesterday, we found out that this filter seems to be overwriting the other contentfilters in stead of being added to it. We noticed that our output is no longer xhtml (e.g. the code gives <BR> in stead of <br />) and the starting and closing '<html></html>'-tags are missing. We tried adding multiple contentFilters to the editor (code added below) but that didn't seem to be working.

RadEditor1.ContentFilters =

EditorFilters.MakeUrlsAbsolute & EditorFilters.ConvertToXhtml & EditorFilters.RemoveScripts & EditorFilters.ConvertFontToSpan;

Is there a way to get the absolute URL's and still keep the other default filters in there?

Kind regards,
Nick.

0
Rumen
Telerik team
answered on 09 Apr 2008, 05:21 PM
Hi Nick,

You should set the ContentFilters enum with | instead of &, e.g.

RadEditor1.ContentFilters = EditorFilters.MakeUrlsAbsolute | EditorFilters.ConvertToXhtml | EditorFilters.RemoveScripts | EditorFilters.ConvertFontToSpan;

Another way to enable only the MakeUrlsAbsolute filter without disabling the rest of the enabled by default filters is using the editor's EnableFilter server method:

RadEditor1.EnableFilter(EditorFilters.MakeUrlsAbsolute);

I hope this helps.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Paul Hopper
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Runi Thomsen
Top achievements
Rank 1
Lini
Telerik team
Scott Smith
Top achievements
Rank 1
Rumen
Telerik team
rdochert
Top achievements
Rank 1
George
Telerik team
christopher willis
Top achievements
Rank 1
AlphaVegas
Top achievements
Rank 2
Nick
Top achievements
Rank 1
Share this question
or