Tpac - add additional subfields for title in search results
authorBen Shum <bshum@biblio.org>
Sat, 17 Mar 2012 02:55:07 +0000 (22:55 -0400)
committerDan Scott <dan@coffeecode.net>
Sat, 17 Mar 2012 04:11:02 +0000 (00:11 -0400)
Originally, titles in Tpac only showed based on tag 245 subfield a.
This sometimes led to difficulty identifying specific records from
each other if it was part of a set or had additional title information
in other subfields.

Modified default title function to include the following:

subfield b = remainder of title
subfield n = number of part/section of a work
subfield p = name of part/section of a work

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Dan Scott <dan@coffeecode.net>
Open-ILS/src/templates/opac/parts/misc_util.tt2

index 95c6f4a..25a8362 100644 (file)
         args.issn = xml.findnodes('//*[@tag="022"]/*[@code="a"]').textContent;
         args.author = xml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent;
 
+        # Include subfields 'abnp' to generate a more comprehensive title display in search results
+        titresults = xml.findnodes('//*[@tag="245"]/*[@code="a" or @code="b" or @code="n" or @code="p"]');
+        titresults_content = [];
+            FOR sub IN titresults; titresults_content.push(sub.textContent); END;
+        args.title = titresults_content.join(" ");
         # Avoid ugly trailing syntax on brief titles
-        args.title = xml.findnodes('//*[@tag="245"]/*[@code="a"]').textContent;
         args.title = args.title | replace('[:;/]$', '');
 
         # Provide correct spacing between the subfields