[Koha-devel] Branches and opac reserve template

Owen Leonard oleonard at athenscounty.lib.oh.us
Wed Jul 30 07:31:02 CEST 2003


> > >
> > the 1st solution MUST be used in every place 
> where you can have a 
> > default value 
> 
> 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


Sounds good to me!  Not only does it move that HTML into the template where it 
belongs, it gives template authors the option of treating that list as 
something other than a drop-down menu (like radio buttons, for instance).  I 
hope this method can become the preferred one.

  -- Owen 




More information about the Koha-devel mailing list