htdig: Frames and HTsearch: HOWTO


Dan Schleifer (dansch@tacticalsolutions.com)
Thu, 17 Sep 1998 15:56:53 +0000


Ok, it seems to be a common problem that people need framesets to load
with the content that is being searched for, so here is the solution I
came up with. I have it set up on my site so that the header and side
bars are one directory down from the content pages and everything but
the content is excluded from being searched by htdig. The exclude line
in htdig.conf takes care of making sure nobody gets anything but the
content I want them to get. The change to TemplateList.cc sends the url

to the perl script instead of the browser, and the perl script takes the

url, gets the right header, side bar, and content and sends it all to
the browser. It seems to work real well. If anybody needs more
explaination, feel free to mail me.

                                                            -Dan
Schleifer

This is what my exclude line in htdig.conf looks like:

exclude_urls: .txt .c.html .s.html .d.html .bak .gif .jpg main topics

Here is the change I made to TemplateList.cc in the htsearch source
directory (made the change then recompiled and installed):

 s << "<dl><dt><strong><a href=\"http://iserver.tacticalsolutions.com
/cgi-bin/frames.pl/$(URL)\">$(TITLE)</a></strong>";
            s << "$(STARSLEFT)\n";
            s << "</dt><dd>$(EXCERPT)<br>\n";
            s << "<i><a
href=\"http://iserver.tacticalsolutions.com/cgi-bin/fram
es.pl/$(URL)\">$(URL)</a></i>\n";
            s << " <font size=-1>$(MODIFIED), $(SIZE) bytes</font>\n";
            s << "</dd></dl>\n";
            t->setMatchTemplate(s);

This is a little perl script (frames.pl) that I wrote and keep in
cgi-bin:

#!/usr/bin/perl
$path = $ENV{'PATH_INFO'};
$path =~ s/^\///;
@pathinfo = split(/\//, $path);
pop(@pathinfo); #@pathinfo[$#pathinfo];
pop(@pathinfo); #@pathinfo[--$#pathinfo];
$subpath = join("/", @pathinfo); #$path;
                                        #$subpath =~ s/$contentname//;
                                        #$subpath =~
s"$contentsubpath"";
print "Content-type: text/html\n\n";
print <<EOF;

ESIS WORKS <BODY> Viewing this page requires a browser capable of displaying frames. </BODY>

EOF

----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig-request@sdsu.edu containing the single word "unsubscribe" in
the body of the message.



This archive was generated by hypermail 2.0b3 on Sat Jan 02 1999 - 16:27:45 PST