[Koha-cvs] CVS: koha/html-template search.pl,NONE,1.1 searchresults.tmpl,NONE,1.1

Steve Tonnesen tonnesen at users.sourceforge.net
Fri May 10 19:08:06 CEST 2002


Update of /cvsroot/koha/koha/html-template
In directory usw-pr-cvs1:/tmp/cvs-serv11882

Added Files:
	search.pl searchresults.tmpl 
Log Message:
Starting to play with HTML::Template
I'm going to work on the search interface instead of the circulation interface
as the search interface is where my librarians want the most changes at the
moment.


--- NEW FILE ---
#!/usr/bin/perl -w
use HTML::Template;

my $template = HTML::Template->new(filename => 'searchresults.tmpl', die_on_bad_params => 0);

$template->param(PET => 'Allie');
$template->param(NAME => 'Steve Tonnesen');


$template->param(SEARCH_RESULTS => [ { barcode => '123456789', title => 'Me and My Dog', author => 'Jack London', dewey => '452.32' },
				     { barcode => '153253216', title => 'Dogs in Canada', author => 'Jack London', dewey => '512.3' },
				     { barcode => '163214576', title => 'Howling at the Moon', author => 'Jack London', dewey => '476' }
				     ]
		);


print "Content-Type: text/html\n\n", $template->output;

--- NEW FILE ---
<html>
<head><title>Test Template</title>
</head>
<body>
Testing <TMPL_VAR NAME=NAME>
<p>
Pet's Name: <TMPL_VAR NAME=PET>
<p>
<hr>
<table border=1>
<tr><th>Barcode</th><th>Title</th><th>Author</th><th>Dewey</th></tr>
<TMPL_LOOP NAME=SEARCH_RESULTS>
  <tr>
  <td> <TMPL_VAR NAME=BARCODE> </td>
  <td> <TMPL_VAR NAME=TITLE> </td>
  <td> <TMPL_VAR NAME=AUTHOR> </td>
  </tr>
</TMPL_LOOP>
</table>
<hr>
</body>
</html>





More information about the Koha-cvs mailing list