From: Ben Shum Date: Sat, 17 Mar 2012 02:55:07 +0000 (-0400) Subject: Tpac - add additional subfields for title in search results X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=18bc30fe1aecdf19a21aaecd769c3ac3194b8fea;p=contrib%2FConifer.git Tpac - add additional subfields for title in search results 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 Signed-off-by: Dan Scott --- diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index 95c6f4a1d4..25a83628e0 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -15,8 +15,12 @@ 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