From: Dan Scott Date: Sun, 25 Aug 2013 04:41:37 +0000 (-0400) Subject: Schema.org authors: relate properties to the right context X-Git-Tag: sprint4-merge-nov22~2800 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ad0da8c8fed4699e8a881d0e1e85cba1742e64bf;p=working%2FEvergreen.git Schema.org authors: relate properties to the right context While the approach of using the existing to launch a new search based on the author name was workable, it may have been confusing for schema.org processors such as Google Rich Snippets who expected that URI to identify a resource for the author, not a set of search results. Using @resource / @about attribute pairing, and wrapping the whole type in an extra element, enables us to avoid associating the properties within the with the implicitly chained type. Signed-off-by: Dan Scott Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/templates/opac/parts/record/authors.tt2 b/Open-ILS/src/templates/opac/parts/record/authors.tt2 index 6d25b3c51c..a13843d41b 100644 --- a/Open-ILS/src/templates/opac/parts/record/authors.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/authors.tt2 @@ -2,6 +2,7 @@ PROCESS "opac/parts/relators.tt2"; +author_cnt = 0; authors = [ { type => 'author', @@ -24,9 +25,11 @@ authors = [ BLOCK build_author_links; FOR node IN ctx.marc_xml.findnodes(xpath); + author_cnt = author_cnt + 1; + contrib_ref = '#schemacontrib' _ author_cnt; + iprop = ''; term = ''; qterm = ''; - iprop = ''; tlabel = ''; birthdate = ''; deathdate = ''; @@ -81,17 +84,17 @@ BLOCK build_author_links; iprop = ' typeOf="Organization" property="contributor"'; END; END; - ''; - IF iprop; ''; END; + ''; + IF iprop; ''; END; term.replace('^\s+', ''); IF iprop; ''; END; IF birthdate; - ' ' _ birthdate _ '-'; + ' ' _ birthdate _ '-'; END; IF deathdate; - '' _ deathdate _ ''; + '' _ deathdate _ ''; END; - ''; + ''; # End search link FOREACH link880 IN graphics; diratt = ''; IF link880.dir; @@ -101,7 +104,8 @@ BLOCK build_author_links; link880.value | html; ''; END; - ' (' _ author_type _ '). '; + ' (' _ author_type _ '). '; + ''; # End author span END; END; %]