From 18bc30fe1aecdf19a21aaecd769c3ac3194b8fea Mon Sep 17 00:00:00 2001 From: Ben Shum Date: Fri, 16 Mar 2012 22:55:07 -0400 Subject: [PATCH] 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 --- Open-ILS/src/templates/opac/parts/misc_util.tt2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.43.2