Re: [htdig] How do I gain control over links inside excerpts?


Subject: Re: [htdig] How do I gain control over links inside excerpts?
From: Gilles Detillieux (grdetil@scrc.umanitoba.ca)
Date: Thu May 18 2000 - 12:02:50 PDT


According to Søren Hermansen:
> Wow! a personal answer. Thank you.

We haven't found a program that could answer questions on this list. :-)

> How do I make an answer show up in the mail thread on htdig.com?

You should put htdig@htdig.org on the Cc: list. This happens automatically
with a reply-to-all or group-reply. I see you're using Elm - a 'g' instead
of a 'r' will select group-reply.

> Anyway here is some more info that could explain what I do:
>
> Yes, you're correct that I modified the templates, here's the long.html {btw:
> DOCID variable is unique, right ?-) m }:

Yes, the DOCID is unique for each document, but there's no guarantee that
a document won't get assigned a new DOCID in a subsequent indexing run.
Indeed, for update runs, all modified documents will be reindexed with a
new DOCID.

> <FORM METHOD="POST" name="s$(DOCID)s" ACTION="http://sun3edb.dmi.min.dk/inetdrif
> t/search.engine/php/gotopage.php3">
>
> <INPUT type="hidden\" name="path" value="$&(URL)">
> <INPUT type="hidden\" name="title" value="$&(TITLE)">
>
> <dl><dt><strong><A href="javascript:document.s$(DOCID)s.submit()">$&(TITLE)</str
> ong></A>$(STARSLEFT)
> </dt><dd>$(EXCERPT)<br>
> <I><A href="javascript:document.s$(DOCID)s.submit()">$&(URL)</A></I>
> <font size="-1">$(MODIFIED), $(SIZE) bytes</font>
> </dd></dl>
> </FORM>
>
> As you can see there's even a layer of php in it.
>
> Concerning the the HIGHLIGHT as we could call it, inside the excerpt. It could
> be manipulatet by an attribute/option in the htdig.conf, but that is for future
> versions of the robot, ofcourse.
>
> Or is all this really possible with the start_/end_highlight, that I just
> noticed? Does other options exist to manipulate HIGHLIGHTs exist?
>
> I think this is all I can supply you for this week.

Well, don't confuse highlighting with anchors. The hilight() function
in htsearch/Display.cc looks after both of these. The highlighting, by
default, makes matching words bold in the excerpt, and by changing the
<strong> and </strong> tags in start_/end_highlight, you can highlight
in other ways (e.g. font color). Also, if the first matching word in
the document appears after an <a name=...> anchor (a.k.a. a "bookmark"),
then the hilight() function will not only highlight the first matching
word in the excerpt, but it will also turn it into a hypertext link to
that anchor (e.g. <a href="URL#name">word</a>).

What you'd need to do would be to change the way Display::displayMatch()
builds the "urlanchor" variable that gets passed to hilight() via
excerpt(). You'd want to set it to some thing like:

        urlanchor = 0;
        urlanchor << "javascript:document.s" << ref->DocID() << "s.submit()";

and then somehow add the anchor to that. I don't know if you can just
tack on a "#name" anchor onto a javascript link like that, though,
or whether the anchor must be somehow embedded in the javascript.
If you just don't want the anchors at all in the excerpt, you can set
the add_anchors_to_excerpt to false in your htdig.conf.

-- 
Gilles R. Detillieux              E-mail: <grdetil@scrc.umanitoba.ca>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

------------------------------------ To unsubscribe from the htdig mailing list, send a message to htdig-unsubscribe@htdig.org You will receive a message to confirm this.



This archive was generated by hypermail 2b28 : Thu May 18 2000 - 09:51:07 PDT