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

Two sites, one RadEditor

4 Answers 68 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Alex Tushinsky
Top achievements
Rank 2
Alex Tushinsky asked on 02 Mar 2009, 07:23 PM
I have a project where the administration of a site takes place in a separate application.  So I have one database which stores content, and two different apps - a user site which displays content, and an admin site, which lets you edit the content.  They are not sub-folders of each other.  Each has its own URL, and different folder under IIS.  Aside from sharing the DB, they also share the physical drive.

I need to implement the RadEditor in the admin site, and while analyzing the requirements, came across the following:

1 - Image upload dialog needs to point to the images folder of the user site.  In the RadEditor properties, I only see a way to set local paths for images ("~/images").  Is there a way to specify a physical folder path, or point it to a full URL (http://myusersite.com/images/)?

2 - I need to make sure that images show up correctly in the editor - does this mean I need to supply a base url? If so, how?  Is there any way to keep the content relative, while letting the editor make it absolute for editing sake?  Meaning, in the content I have <img src="images/mypic.gif" />, but the editor is smart enough to load the image using http://myusersite.com/images/mypic.gif, but then save the relative path to the database?

Any help is greatly appreciated!

Thanks,
Alex

4 Answers, 1 is accepted

Sort by
0
hacker
Top achievements
Rank 1
answered on 03 Mar 2009, 11:54 PM
Hi Alex,

I am running into a similar situation but with CSS files.  If you get anywhere with this, please share and I will do the same.

Thanks,
Shawn
0
Rumen
Telerik team
answered on 04 Mar 2009, 10:25 AM
Hi guys,

My suggestion is to map the Images folder of your admin and public sites to point to your web application root folder using IIS. This will change the image src to <img alt="" src="Images/filename.png" /> and the image will be accessible and visible in the public and admin sites.
Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
hacker
Top achievements
Rank 1
answered on 04 Mar 2009, 01:40 PM
Hi Rumen,

Thanks for the reply.  In my case, I use the ASP.NET Development Server a lot while debugging, so I don't think that would work.  For IIS, a Virtual Folder would be fine and that would work for me.

I did a couple of quick searches and can't find a way to create a Virtual Directory in Cassini, so I don't know if this would work. 

If I were to physically copy the files between the two sites, it would be a pain to keep them both up to date.  I can physically access the files from both sites (C:\Webs\....) but it looks like the CSSFiles property only accepts relative paths to the application.

Shawn
0
Rumen
Telerik team
answered on 09 Mar 2009, 08:10 AM
Hello Soatley,

Yes, Cassini (the development web server of VS) does not support virtual directories and the solution can be tested only in IIS. However this is enough because in production the web sites are hosted in IIS, because Cassini is used for local test development.

The path loaded via the CssFiles property should be relative to the root of your web application, e.g.

RadEditor1.CssFiles.Add("~/styles/generic_style.css")

The css file path should not point to another domain because Firefox will restrict this file and the editor will be not able to read the classes in it. That is why this code will work only in IE:

RadEditor1.CssFiles.Add("http://www.bnl.gov/styles/generic_style.css");

The CssFiles does not work with physical paths because they will be not accessible via the web.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Alex Tushinsky
Top achievements
Rank 2
Answers by
hacker
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or