[Koha-devel] Branches and opac reserve template

Chris Cormack chris at katipo.co.nz
Tue Jul 29 15:14:19 CEST 2003


> > 
> >
> the 1st solution MUST be used in every place where you can have a 
> default value (until someone shows me readable & easy-to-understand 
> template-only method)
> the 2nd may be more versatile, but only when there is no default value.
> 
Hi guys

You can do the second method, with a default value. Its just a little tricky
heres a snippet

tr valign="top">
<td>Language:</td>
<td> <Select name="language">
<TMPL_LOOP NAME="languages">
<option value="<TMPL_VAR NAME="language">"
<TMPL_IF NAME="selected">Selected</TMPL_IF>><TMPL_VAR
NAME="language"></option>
</TMPL_LOOP>
</select>
</td>
</tr>

and for one element of your languages array, it will have selected set, eg

$languages->[3]->{'selected'}=1

Hope this helps

Chris
-- 
Chris Cormack                                                     Programmer
027 4500 789                                       Katipo Communications Ltd
chris at katipo.co.nz                                          www.katipo.co.nz




More information about the Koha-devel mailing list