Skip to main content.
home | support | download

Back to List Archive

Re: multiple select_by_meta in swish.cgi

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Mon Nov 06 2006 - 17:51:48 GMT
On Mon, Nov 06, 2006 at 07:55:59AM -0800, Cas Tuyn wrote:
> All my extra search fields (Sector, Department, Extension) work out of
> the box, but now that I want to make it a little more userfriendly, I
> get the following problem, it looks like I can only have one
> select-by-meta to replace limiting factors on the query.

Yes, that's true.  The configuration is a hash so if you do:

    my $config = {
        select_by_meta => $stuff,
        select_by_meta => $other_stuff,
    };

Then the first one is replaced by the second one.  That is, the keys
of a hash must be unique.

> I want to see both, and want to get rid of the "Sort-By" line that
> comes standard. Any ideas?

My memory of swish.cgi is not that great, but I guess if I wanted to
do this I'd search out all the places where "select_by_meta" is used
and duplicate the code with "select_by_meta2" or some such thing.

> At a later stage I want to layout the form such that it uses minimal
> vertical room, yet presents the sector and extension options
> vertically. Is that possible using TemplateDefault.pm, or should I use
> that to make it work functionally, and then lay it out the way i want
> keeping the technical bits in place?

Depends on your project.  I'd likely just edit (or copy)
TemplateDefault.pm and make changes there.  I'd shift more formatting
to css, too.  But, if I was building a complete site I'd be using
Template Toolkit, and so my search forms and results would also use TT
and be integrated with the site's templates and css for overall layout.

swish.cgi was suppose to be a script that does quite a few thing (some
of them optionally) but not do everything.  If you want to really
customize things I'd probably use search.cgi as a starting point and
create all the custom requirements from scratch.  If you are good in
Perl (or your favorite scripting language) then it's not that much
work and then you have a cleaner script and templates that do only
what you want.

-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs
   swish-e@sunsite.berkeley.edu
Received on Mon Nov 6 09:51:49 2006