From: Dan Scott Date: Wed, 10 Dec 2014 22:05:38 +0000 (-0500) Subject: LP#1401286: Cleaner display of URIs in search results X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c1758188abca343b5d2718a44df4c02fa6ef1fe3;p=evergreen%2Fpines.git LP#1401286: Cleaner display of URIs in search results Right now a record with an 856 like: 856 40 $zAvailable online $uhttp://publications.gc.ca $9LUSYS shows up in search results with an HTML display like: http://publications.gc.ca - Available online rather than the much cleaner: Available online My simplistic approach is to check to see if the link text == the href, and if so, and we have a note to display, to use the note as the text of the link instead. Signed-off-by: Dan Scott Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index 691f403ebb..a8d18f9382 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -433,6 +433,11 @@ res.href = uri.getAttribute('href'); res.link = uri.getAttribute('label'); res.note = uri.getAttribute('use_restriction'); + # Avoid displaying the href as the link text if we can display the note instead + IF res.link == res.href AND res.note; + res.link = res.note; + res.note = ''; + END; args.uris.push(res); END; NEXT;