Re: [htdig] multiple build_select_lists on restrict

Subject: Re: [htdig] multiple build_select_lists on restrict
From: Gilles Detillieux (
Date: Fri Aug 11 2000 - 07:55:03 PDT

According to Daniel Burn:
> we'd like to get a number of different possible select lists using
> build_select_list for restricting searchs. What we want is to be able to
> select which list of restrictions we are using in an initial form, which
> htsearch then uses in a search form in its header.html.
> Is this possible at the moment? I can't see any way of doing it, and the docs
> don't seem to mention it being possible (they also don't mention it being
> impossible).
> If it's not possible, can it be added to a wanted features list?
> I'd imagine something like :
> ------
> build_select_lists: RESTRICT_LIST1 restrict restrict_list1 2 1 2 restrict ""
> restrict_list1: "" "All Pages" \
> "" "Some subset"
> build_select_lists: RESTRICT_LIST2 restrict restrict_list2 2 1 2 restrict ""
> restrict_list2: "" "All Pages" \
> "" "Some othersubset"
> in the conf file, and in the form doing something like
> <input type=hidden restrict_list=RESTRICT1>.
> ------
> either that, or having some soert of synonyms in the config file, like:
> ------
> option_synonym: restrict1 restrict
> option_synonym: restrict2 restrict
> build_select_lists: RESTRICT_LIST1 restrict1 restrict_list1 2 1 2 restrict1 ""
> restrict_list1: "" "All Pages" \
> "" "Some subset"
> build_select_lists: RESTRICT_LIST2 restrict2 restrict_list2 2 1 2 restrict2 ""
> restrict_list2: "" "All Pages" \
> "" "Some othersubset"
> so that the forms return 'restrict1', and htsearch knows that it means
> 'restrict'.

Well, there are two separate issues here, as I see it. First of all,
you can define multiple select lists, by chaining them together as a
single build_select_lists definition. The examples in the documentation
show this. (There is a reason that the attribute name is plural.)
Defining multiple instances of the same attribute doesn't work, as the
last value simply overrides previous ones.

The crux of your request though, is whether you can use an input parameter
to select between different config attribute settings or different
template variable names in the final output. I don't believe you can.
Selecting a template variable name by an input parameter would require
doubly expanding variables in the template output, which htsearch does
not do.

Selecting different config attributes by an input parameter would require
variable substitutions on input parameters - a hole that we just closed.
Allowing this opens a whole can of worms, as it allows the user to get
at any config attribute, or for that matter any file on your system,
as variable and file expansion is all part of the same parsed string

The only way around this that I can see would be to have multiple
configuration files that define the different restrict lists, and have
a user-selectable "config" input parameter to choose which config file
you want.

Gilles R. Detillieux              E-mail: <>
Spinal Cord Research Centre       WWW:
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 You will receive a message to confirm this.

This archive was generated by hypermail 2b28 : Thu Aug 10 2000 - 21:55:05 PDT