Gossamer Forum
Home : Products : Others : Fileman :

Base HREF fix to see images in HTML editor

Quote Reply
Base HREF fix to see images in HTML editor
I gave the fix shown below a try and it does help but doesn't quite fix the problem. What happens is, if the images for a page are in a sub dir ... ie: root/help/helpimages/image.gif the editor now looks for the images in ... root/helpimages/image.gif.

Now, we can't really have image folders on scattered all over the root - very messy indeed! So, instead of having <%HOST%> defined as the root could we have it defined as... root/images/ ? This way we could create an image folder at the root and then place sub directories in the image folder, containing the images for particular pages. I believe this would be a good trade off that would allow us to see our images when using the wysiwyg editor on most of the pages in a site. Any ideas how to make this change? It sounds like a small change in coding but I'm not a programmer so I could be way off base here.

I installed this script primarily as a means to manage files remotely, but then found the inclusion of the code editor really helps speed up small changes to files. All in all, the text editor is what I use most but now I guess I'm getting a little greedy!

Thank you so much for this wonderful product. I can't imagine using anything else when I'm off site, and find I even use it for quick code fixes when I'm in the office.

1. Add these new lines ,in red , at the end of FileMan.pm:
Code:

sub js_quote_include {
my $file = shift;
my $tags = GT::Template->tags;
my ($host) = $tags->{html_url} =~ m,(\w+://[^/]*?/)?,;

my $in = new GT::CGI;
my $css_file = $in->cookie('scheme') || 'fileman';
my $color;
CASE: {
($css_file eq 'fileman') and $color = '#D6D6D6', last CASE;
($css_file eq 'gt') and $color = '#d9e4f2', last CASE;
($css_file eq 'maple') and $color = '#F0E8CE', last CASE;
($css_file eq 'rainy') and $color = '#CFD8C2', last CASE;
($css_file eq 'rose') and $color = '#DEC9CE', last CASE;
}
my $parsed = GT::Template->parse("$tags->{template_root}/common/$file",
{
host => $host,
html_url => $tags->{html_url},
scrollbar_arrow_color => 'black',
scrollbar_base_color => $color,
editor_base_color => $color,
advanced_editor_background => 'white',
advanced_editor_font => 'arial'});
$parsed =~ s{([\\/'"<>])}{\\$1}g;
$parsed =~ s/(?:\r\n|\r|\n)/\\n/g;
return \$parsed;
}


2. Add a new line <base href="<%host%>"> to templates/common/editor_editor.html, below the HEAD tag.
Subject Author Views Date
Thread Base HREF fix to see images in HTML editor zedd 4864 Dec 4, 2002, 7:05 AM
Thread Re: [zedd] Base HREF fix to see images in HTML editor
604 4718 Dec 4, 2002, 11:15 AM
Thread Re: [TheStone] Base HREF fix to see images in HTML editor
zedd 4702 Dec 4, 2002, 2:32 PM
Post Re: [zedd] Base HREF fix to see images in HTML editor
zedd 4694 Dec 4, 2002, 4:06 PM