Skip to main content.
home | support | download

Back to List Archive

Adding new drop downs to

From: David Fishburn <fishburn(at)>
Date: Thu Dec 11 2003 - 19:22:44 GMT
Linux fishburn-RH9 2.4.20-20.9 #1 Mon Aug 18 11:45:58 EDT 2003 i686 i686
i386 GNU/Linux
SWISH-E 2.4.0
This is perl, v5.8.0 built for i386-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)

Bill just recently made a patch for me to correctly display the
select_by_meta fields using the LIMITS section in the swish.tmpl.

I wanted to add another drop down, called Language.

I am not having any success adding this new drop down, so I was hoping
someone could give me some tips.

First, in swish.tmpl
I added this section (just before the LIMITS one):
            <TMPL_IF LANGUAGES>
                Getting closer to languages
                <TMPL_VAR LANGUAGE_TITLE>
                <select name="metaname">
                    <TMPL_LOOP LANGUAGES>
                        <option  value="<TMPL_VAR NAME>" ><TMPL_VAR

Next, in my /var/www/cgi-bin/.swishcgi.conf I added (just before the
select_by_meta tags):
        language_by_meta  => {
            #method     => 'radio_group',  # pick: radio_group, popup_menu,
or c
            #method     => 'checkbox_group',
            method      => 'popup_menu',
            columns     => 3,
            metaname    => 'ami_language',     # Can't be a metaname used
            # Use the array from which was generated
            # from the MySQL database
            values      => \@language,
            # Use the hash from which was generated
            # from the MySQL database
            labels      => \%language,
            description => 'Choose Language: ',

Next, in my /usr/lib/swish-e/perl/SWISH/
I cloned the LIMITS/Limits section and changed its name:
    # Language Select
    my $Language = $results->config('language_by_meta');
    if ( $Language ) {
        $params->{LIMIT_TITLE} = $Language->{description} || 'Choose
        my $labels = $Language->{labels} || {};

        $params->{LIMITS} = [ map { { VALUE => $_, LABEL => ($labels->{$_}
|| $_
>>) } } @{$Language->{values}} ] if $Language;

This never results is anything additional being displayed to the search
I wasn't sure where these 2 items get populdated/defined:

TIA for any advice.

Received on Thu Dec 11 19:23:21 2003