Link from copies to library info page
authorDan Scott <dscott@laurentian.ca>
Tue, 17 Dec 2013 21:29:35 +0000 (16:29 -0500)
committerDan Wells <dbw2@calvin.edu>
Tue, 21 Jan 2014 19:57:42 +0000 (14:57 -0500)
In the absence of a specific lib.info_url org unit setting, link to the library
info page.

If we _do_ have a lib.info_url org unit setting, link from the library info
page to to the external web site.

Rather than wrapping everything in the table cell as the seller, focus
on the <a> and give it an explicit Library typeof attribute; then we can
offer up the name of the library as the name attribute, should the
crawler be too lazy to follow the link.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/templates/opac/parts/record/copy_table.tt2

index 9c8407b..736ee06 100644 (file)
@@ -93,12 +93,16 @@ END; # FOREACH bib
             [%- IF serial_holdings %]<td headers='copy_header_holding_label' class='rdetail-issue-issue'>
                 [%- copy_info.holding_label | html; -%]
             </td>
             [%- IF serial_holdings %]<td headers='copy_header_holding_label' class='rdetail-issue-issue'>
                 [%- copy_info.holding_label | html; -%]
             </td>
-            [%- ELSE %]<td headers='copy_header_library' property="seller">
+            [%- ELSE %]<td headers='copy_header_library'>
             [%-
                 org_name = ctx.get_aou(copy_info.circ_lib).name;
             [%-
                 org_name = ctx.get_aou(copy_info.circ_lib).name;
+                org_sname = ctx.get_aou(copy_info.circ_lib).shortname;
                 lib_url = ctx.get_org_setting(copy_info.circ_lib, 'lib.info_url');
                 lib_url = ctx.get_org_setting(copy_info.circ_lib, 'lib.info_url');
-                IF lib_url; '<a href="'; lib_url | url; '">'; END;
-                org_name | html;
+                UNLESS lib_url;
+                    lib_url = mkurl(ctx.opac_root _ '/library/' _ ctx.get_aou(copy_info.circ_lib).shortname, {}, 1);
+                END; 
+                IF lib_url; '<a property="seller" typeof="Library" href="'; lib_url | url; '">'; END;
+                '<span property="name">'; org_name | html; '</span>';
                 IF lib_url; '</a>'; END;
             -%]
                 <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
                 IF lib_url; '</a>'; END;
             -%]
                 <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">