Meaningful title elements for record details and search results
authorDan Scott <dan@coffeecode.net>
Mon, 27 Jun 2011 18:18:39 +0000 (14:18 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 27 Jun 2011 18:38:24 +0000 (14:38 -0400)
Rather than the generic "Record Details" and "Search Results", populate
the <title> element with the actual title of the record or the search
query, respectively.

We punt on advanced search results for now, until we can parse the array
into something usable.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/templates/default/opac/parts/record/summary.tt2
Open-ILS/web/templates/default/opac/results.tt2

index 582b98b..4dbfadc 100644 (file)
@@ -1,3 +1,4 @@
+[% ctx.page_title = attrs.title | html_entity %]
 <!-- ****************** rdetail_summary.xml ***************************** -->
 <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% ctx.bre_id %]'></abbr>
 <!-- This holds the record summary information -->
index 0fb4c31..d0b6d28 100644 (file)
@@ -3,7 +3,12 @@
 
     WRAPPER "default/opac/parts/base.tt2";
     INCLUDE "default/opac/parts/topnav.tt2";
-    ctx.page_title = l("Search Results");
+
+    IF is_advanced;
+        ctx.page_title = l("Search Results");
+    ELSE;
+        ctx.page_title = l("Search Results: ") _ CGI.param('query') | html_entity;
+    END;
 
     page = CGI.param('page') || 0;
     page_count = POSIX.ceil(ctx.hit_count / ctx.page_size);