LP#1406013: Improve schema.org expression for electronic resources
authorDan Scott <dscott@laurentian.ca>
Sat, 27 Dec 2014 22:06:18 +0000 (17:06 -0500)
committerBen Shum <bshum@biblio.org>
Mon, 16 Feb 2015 09:29:12 +0000 (04:29 -0500)
Specify the URL from which an electronic resource is available as the
schema:url of the associated schema:Offer. Also, if we have descriptive
link text and/or a note about the electronic resource, mark it up with
schema:description.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>

Open-ILS/src/templates/opac/parts/record/summary.tt2

index 79ab4ff..2db3a65 100644 (file)
@@ -122,7 +122,15 @@ IF num_uris > 0;
         [%- ELSE -%]
             <li class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
         [%- END -%]
-        <a href="[% uri.href %]">[% uri.link %]</a>[% ' - ' _ uri.note IF uri.note %]
+        <a href="[% uri.href %]" property="url">
+        [%- IF uri.href != uri.link;
+                '<span property="description">' _ uri.link _ '</span>';
+            ELSE;
+                uri.link;
+            END;
+        -%]
+        </a>
+        [%- ' - <span property="description">' _ uri.note _ '</span>' IF uri.note %]
         <link property="availability" href="http://schema.org/OnlineOnly" />
         [%- IF attrs.gtin13; '<meta property="gtin13" content="' _ attrs.gtin13 _ '" />'; END; %]
         [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]