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

Base URL

1 Answer 104 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jamie Walker
Top achievements
Rank 1
Jamie Walker asked on 01 Jun 2010, 09:41 PM
If I'm using the Editor to manage content on a different domain, is there an easy way to set the base URL for the content displayed in the Editor so that images relative to the other domain will resolve?  I see that if I'm editing an entire HTML document, I have the ability to set the "Base location" in the "Page Properties."  Is there a way for me to set this value programmatically?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Jun 2010, 01:12 PM
Hi Jamie,

By default, RadEditor generates images with relative paths and if the images folder is mapped as a virtual folder pointing to the root of both sites in IIS then the images will be rendered without problems in the editor and in the public site.

Another approach is to enable the MakeUrlsAbsolute filter of RadEditor:
RadEditor1.EnableFilter(Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute);
which will make all src attributes in the editor content have absolute URLs.
After that using String.Replace on the server, you will be able to replace or strip the desired part of the URL and therefore display the image correctly on the public site.

All the best,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
Jamie Walker
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or