Re: navigation bar

From Stefan Boddie
DateFri, 20 Sep 2002 10:02:25 +1200
Subject Re: navigation bar
In-Reply-To (000c01c25fbe$86e25500$6d809e89-cs-uct-ac-za)
> Here is some code from the following method
> void documentaction::set_navbarmacros (displayclass &disp,
> FilterResponse_t &response,
> cgiargsclass &args) {
> the code i'm talking about is shown below
> while (dochere != docend) {
> text_t title = (*dochere).metadata["Title"].values[0];
> count++;
> I don't want the navigation bar to have all the different searching
> facilities. I want it to have 2 options. Our research has shown that
> title A-z and search are used the most so we want to only have
> these two options available. Say if titles isn't available then we'll
> have subjects as it was the next popular etc...
> How can I do this. I assume that I should be able to get information
> on what search options are available from
> text_t title = (*dochere).metadata["Title"].values[0];
> or maybe I might have to change the "Title" to something else. I'm
> sure its easy to do, I just don't know how?
> I would appreciate any help.
> cheers
> Dynal


Is there are reason you don't want to do this at collection build time? If
you remove all but the AZList classify line from the collect.cfg file and
rebuild you'll get the desired result.

If you're really committed to doing it at runtime I'd suggest you scrap the
set_navbarmacros() function and start over. As a simple case you could
replace it with something like the following completely untested code.

text_t navigationbar = "<a href=\"_httpquery_\">search</a><br>\n";
while (dochere != docend) {
if ((*dochere).metadata["Title"].values[0] == "Title") {
navigationbar += "<a href=\"_httpdocument_&cl=" + (*dochere).OID +
"\">titles a-z</a>\n";
disp.setmacro ("navigationbar", "Global", navigationbar);


This discussion is a little too technical for this list. If you want to
continue it you should probably use the greenstone_devl list instead.