Pretty OPAC biblio record : patch
When I started playing around with Koha 1.2.2, I found that the biblio record display in the OPAC catalogue search detail wasn't pretty or functional enough for me. Below are diffs for the changes I made to detail.pl. They make the following changes: * the Author becomes a link to search.pl with the appropriate argument. * the Additional Author field becomes an unordered list, with each name as a link to search.pl. A substitution removes any trailing qualifiers commonly used by the Library of Congress for motion picture authorship -- that is, if "BROOKS, MEL, DIRECTION, PRODUCTION, CAST" is an additional author on a movie, the titles are removed so the search is for "BROOKS, MEL." * the Subject field becomes an ordered list, with each subject as a link to search.pl. I'll probably modify this some more to recognize " -- " and the em dash (%97) as hierarchical separators, and divide up the link, so that "PROGRAMMING -- LANGUAGES" has two links: the word "programming" as a search for that word, and the word "languages" as a search for "programming -- languages." These diffs are against the version in intranet-cgi. That version can, of course, be used in the opac-cgi location too. 10a11
use URI::Escape; 120a122,146 } if ($dat->{'author'} ne ''){ print "<B>Author:</B> <A HREF=\"search.pl?author="; my $autlink=$dat->{'author'}; $autlink =~ s/(, DIRECTION|, WRITING|, CAST|, PRODUCTION)//ig; my $htautlink = uri_escape($autlink); print "$htautlink\&type=opac\">$dat->{'author'}</A><BR>"; } #Additional Author: <br> if ($additional ne ''){ my $adstr = $additional; my @adar = split /\s*\|/, $adstr; print "<B>Additional Author"; if(scalar @adar > 1){ print "s"; } print ": </B><UL>"; my $autitem; foreach $autitem (@adar) { print "<LI>"; print "<A HREF=\"search.pl?author="; my $autlink = $autitem; $autlink =~ s/(, DIRECTION|, WRITING|, CAST|, PRODUCTION)//ig; my $htitem = uri_escape($autlink); print "$htitem\&type=opac\">$autitem</A>"; } print "</UL>"; 122,125c148 < if ($dat->{'author'} ne ''){ < print "<b>Author:</b> $dat->{'author'}<br>"; < } < #Additional Author: <br>
print "\n"; 130c153,166 < print "<b>Subject:</b> $dat->{'subject'}<br>";
my $subj = $dat->{'subject'}; $subj =~ s/^\s*\|\s*//; my @subar = split /\|\s+/, $subj; print "<B>Subject:</B> <OL>"; my $subitem; SUBLOOP: foreach $subitem (@subar) { print "<LI>"; print "<A HREF=\"subjectsearch.pl?subject="; $subitem =~ s/\s*$//; my $htitem = uri_escape($subitem); print "$htitem\&type=opac\">$subitem</A>"; } print "</OL>\n";
-- Rob Levandowski robl@macwhiz.com
On Thu, 2002-08-08 at 15:01, Rob Levandowski wrote:
When I started playing around with Koha 1.2.2, I found that the biblio record display in the OPAC catalogue search detail wasn't pretty or functional enough for me.
Below are diffs for the changes I made to detail.pl. They make the following changes:
Excellent :) You might like to take a look at the latest 1.2.3 RC. The opac has been rewritten to use HTML::Template, which makes making the changes you have made much easier. If you get a chance can you take a look, and see what you think. Chris -- Chris Cormack chris@katipo.co.nz Programmer 025 500 789 Katipo Communications www.katipo.co.nz
participants (2)
-
Chris Cormack -
Rob Levandowski