I've read so many problems with this but no answers. Has anybody gotten relative paths to work inside the editor to fix broken images and links?? I'm using ASP.NET and the only thing that works for me are these:
fckeditor.BaseHref = "http://mydomain.com/sites/sandbox1/";
fckeditor.Config["BaseHref"] = "http://mydomain.com/sites/sandbox1/";
But why don't these work (in IE and Firefox):
fckeditor.BaseHref = "~/sites/sandbox1/";
fckeditor.BaseHref = "/sites/sandbox1/";
fckeditor.BaseHref = "../sites/sandbox1/";
fckeditor.BaseHref = "../../sites/sandbox1/";
fckeditor.BaseHref = "../../../sites/sandbox1/";
fckeditor.BaseHref = "../../../../sites/sandbox1/";
fckeditor.BaseHref = "../../../../../sites/sandbox1/";
fckeditor.Config["BaseHref"] = "~/sites/sandbox1/";
fckeditor.Config["BaseHref"] = "/sites/sandbox1/";
fckeditor.Config["BaseHref"] = "../sites/sandbox1/";
fckeditor.Config["BaseHref"] = "../../sites/sandbox1/";
fckeditor.Config["BaseHref"] = "../../../sites/sandbox1/";
fckeditor.Config["BaseHref"] = "../../../../sites/sandbox1/";
fckeditor.Config["BaseHref"] = "../../../../../sites/sandbox1/";
The thing is that each sub-site references the images in the html code as <img src="images/someimage.jpg">. But once I go into FCKeditor editor's mode, the image no longer display because they expect <img src="sites/sandbox1/images/someimage.jpg">.
By the way, if I try to insert an image and browse, FCKeditor shows my list of images just fine, so my UserFilesPath is fine. Since this is a common problem, I'm hoping that this is corrected or at least made more friendly to use for multi-site websites. I've searched high and low in the forums and wiki, nothing solves this. I would greatly appreciate any help.
Wed, 01/16/2008 - 19:53
#1
Re: BaseHref relative path do not work (multi-site)
Re: BaseHref relative path do not work (multi-site)
I figured this out inspecting the generated DOM, but it would be much easier if in the help, instead of just writing:
you specify something about the BASE tag.
Moreover: why not trying something to make it work with relative paths? I think in javascript it's not so difficult to generate an absolute path from the union of the editor's url and the specified relative baseHref...