Branches and opac reserve template
I notice that in the default template opac-reserves.tmpl has this code: Please select the branch from which you want to collect the item: <TMPL_VAR NAME="CGIbranch"> ...which produces an html select list. On the other hand, the vanilla template has this code: <TMPL_LOOP NAME="BRANCHES"> <td VALIGN="TOP"><INPUT TYPE="radio" name="branch" value='<TMPL_VAR NAME="branchcode">' class="checkbox"></td> <td VALIGN="TOP"><TMPL_VAR NAME="branchname"></TD> </TMPL_LOOP> ...which is nice in that in using the loop it give template-writers the flexibility to choose their input method. Unfortunately, the latter code snippet doesn't work! It doesn't produce anything, so I guess the 'BRANCHES' array hasn't been populated. Is the template expecting a different version of opac-reserves.pl? I notice that the HLT site has other options as well, like being able to choose acceptable formats. What's the story? Will these features be rolled into 2.0? -- Owen ---- Nelsonville Public Library Koha 2.0.0-pre2-R2
Owen Leonard wrote:
I notice that in the default template opac-reserves.tmpl has this code:
Please select the branch from which you want to collect the item: <TMPL_VAR NAME="CGIbranch">
...which produces an html select list. On the other hand, the vanilla template has this code:
<TMPL_LOOP NAME="BRANCHES"> <td VALIGN="TOP"><INPUT TYPE="radio" name="branch" value='<TMPL_VAR NAME="branchcode">' class="checkbox"></td> <td VALIGN="TOP"><TMPL_VAR NAME="branchname"></TD> </TMPL_LOOP>
...which is nice in that in using the loop it give template-writers the flexibility to choose their input method. Unfortunately, the latter code snippet doesn't work! It doesn't produce anything, so I guess the 'BRANCHES' array hasn't been populated. Is the template expecting a different version of opac-reserves.pl? I notice that the HLT site has other options as well, like being able to choose acceptable formats. What's the story? Will these features be rolled into 2.0?
-- Owen
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. -- Paul POULAIN Consultant indépendant en logiciels libres responsable francophone de koha (SIGB libre http://www.koha-fr.org)
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@katipo.co.nz www.katipo.co.nz
participants (3)
-
Chris Cormack -
Owen Leonard -
paul POULAIN