Skip to main content.
home | support | download

Back to List Archive

Re: Problem with popup_menu and swish.cgi

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Mon Dec 01 2003 - 23:57:55 GMT
On Mon, Dec 01, 2003 at 03:27:31PM -0800, David Fishburn wrote:
> When I run the swich.cgi script in my web browser (mozilla), I get
> checkboxes instead of a drop down menu (<OPTION>).
> In fact, this doesn't work either:
>             method      => 'radio_group',  # pick: radio_group,
> popup_menu, or checkbox_group
> I always end up with checkboxes.

Right.  As you found out it's not implemented in the template.

   <TMPL_IF LIMITS>
        <!-- not really implemented -->
        <br><TMPL_VAR LIMIT_TITLE>   
        <TMPL_LOOP LIMITS>
            <input type="checkbox" name="sbm" value="<TMPL_VAR VALUE>" /><TMPL_VAR LABEL>
        </TMPL_LOOP>
    </TMPL_IF>

I'm not sure if that was an oversight or just plain laziness.  Probably
by design.

The templates came late in swish.cgi.  So before the templates there was
that config stuff to adjust the output.  But with the templates I think
it is better to adjust the output in the template.  (I break that rule
in the Template-Toolkit version, IIRC.)

> So I tried changing the /usr/share/swish-e/swish.tmpl
> 
> I added the following section after the:
>             <TMPL_IF SORTS>
> section.
> 
> 	<TMPL_IF SELECT_BY_META>
>                 Added by SELECT_BY_META:
>                 <select name="metaname">
>                     <TMPL_LOOP SORTS>
>                         <option  value="<TMPL_VAR NAME>" ><TMPL_VAR
> LABEL></option>
>                     </TMPL_LOOP>
>                 </select>
>             </TMPL_IF>
> 
> This is never displayed at all.

Is "SELECT_BY_META" defined some place?



-- 
Bill Moseley
moseley@hank.org
Received on Mon Dec 1 23:58:02 2003