Re: [greenstone-devel] Reproducing drop down navigation menus in Greenstone

From Michael Dewsnip
DateThu, 14 Jul 2005 16:38:29 +1200
Subject Re: [greenstone-devel] Reproducing drop down navigation menus in Greenstone
In-Reply-To (1120805504-8513-65-camel-localhost-localdomain)
Hi Daniel,

Greenstone has code for dealing with relative links in source documents,
so I think you can get the effect you're after by tapping into this.

In a simple case, imagine a Greenstone collection with two documents,
doc1.html and doc2.html, each with a relative link to the other, eg:

<a href="doc2.html>Link to doc2.html</a>

When you build this collection, Greenstone will replace the relative
links with calls to the Greenstone "extlink" action:

<a href="/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-preferences-Amin+Hedjazi--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=extlink&rl=1&href=http://doc2.html">Link to doc2.html</a>

This means that when you're browsing the built collection and click on
the link, Greenstone will redirect you to the appropriate document.

In your case, you need to extend the option values to have the full
relative paths, since the value must uniquely identify a document:

<option value="http://foldername/substantive.htm">Substantive
variants</option>

When your users select one of these options, loading
"/gsdlmod?a=extlink&rl=1&href=[value]" should take you to the correct
document.

Hope this helps,

Michael

Daniel Paul O'Donnell wrote:

>Hi,
>I've gone through the archives and documentation, and while I can find
>a number of almost similar examples to this problem, I can't find
>anything that does the crucial thing I need to answer the problem.
>Please excuse me if that's because the answer is so obvious nobody's
>ever asked. I have gone over it with a real expert, though.
>Basically, the issue is that in an HTML document set, I use drop down
>menus with javascript to navigate between different "views" of a text.
>There can be as many as 12 different "views" so a list of links is
>inefficient; it also doesn't get the idea across that all 5 to 12
>documents are actually the same text with different features emphasised.
>Here is the code I use in my HTML:
>
><form action="" class="changeView">
> <select name="choices" size="1"
>onchange="location=document.view.choices.options[document.view.choices.selectedIndex].value">
> <option value="index.htm">Reading text</option>
> <option selected="selected" value="significant.htm">Significant
>variants</option>
> <option value="substantive.htm">Substantive variants</option>
> <option value="orthographic.htm">Orthographic variants</option>
> <option value="analytic.htm">All readings (analytic)</option>
> <option value="parallel.htm">All readings (parallel)</option>
> </select>
></form>
>
>The trouble in Greenstone is that these URLs on option@value are not
>converted to hash addresses. It appears that what I need to do is write
>a macro for the Javascript, but I confess I'm not sure how to do it so
>the values are correctly converted to Greenstone hashes (if that's the
>right term). There are a fair number of examples of almost identical
>code in the archives, but none that seem to be used for arbitrary
>addresses like this. Any suggestions?
>
>-d
>
>