From: Dan Scott Date: Thu, 19 Feb 2015 16:08:32 +0000 (-0500) Subject: LP#1423585 Add Open Graph Protocol markup to TPAC X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=efd0c1f9cb4f971658f06cade9b052f1710229c7;p=evergreen%2Fmasslnc.git LP#1423585 Add Open Graph Protocol markup to TPAC Very simplistic markup for now, just the basic http://ogp.me requirements of title, url, image, and type (and we're reusing the schema.org type in the short term). Signed-off-by: Dan Scott Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 4147b8f276..b1527fb87d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -309,6 +309,9 @@ sub load_common { } } + # List of and elements to populate + $ctx->{metalinks} = []; + $self->extract_copy_location_group_info; $ctx->{search_ou} = $self->_get_search_lib(); $self->staff_saved_searches_set_expansion_state if $ctx->{is_staff}; diff --git a/Open-ILS/src/templates/opac/advanced.tt2 b/Open-ILS/src/templates/opac/advanced.tt2 index d6bf8e93f4..8efb9f2eed 100644 --- a/Open-ILS/src/templates/opac/advanced.tt2 +++ b/Open-ILS/src/templates/opac/advanced.tt2 @@ -5,7 +5,7 @@ pane = CGI.param("pane") || "advanced"; loc = ctx.search_ou; - metalinks = ''; + ctx.metalinks.push(''); -%]

[% l('Advanced Search') %]

diff --git a/Open-ILS/src/templates/opac/browse.tt2 b/Open-ILS/src/templates/opac/browse.tt2 index e7557e12b2..3a8397d391 100644 --- a/Open-ILS/src/templates/opac/browse.tt2 +++ b/Open-ILS/src/templates/opac/browse.tt2 @@ -10,7 +10,7 @@ blimit = CGI.param('blimit') || ctx.opac_hits_per_page || 10; depart_list = ['blimit', 'bterm', 'bpivot']; - metalinks = ''; + ctx.metalinks.push(''); %]

[% l('Catalog Browse') %]

diff --git a/Open-ILS/src/templates/opac/cnbrowse.tt2 b/Open-ILS/src/templates/opac/cnbrowse.tt2 index 09a6b5ce15..a0908f6a9c 100644 --- a/Open-ILS/src/templates/opac/cnbrowse.tt2 +++ b/Open-ILS/src/templates/opac/cnbrowse.tt2 @@ -3,7 +3,7 @@ PROCESS "opac/parts/header.tt2"; PROCESS "opac/parts/misc_util.tt2"; - metalinks = ''; + ctx.metalinks.push(''); WRAPPER "opac/parts/base.tt2"; INCLUDE "opac/parts/topnav.tt2"; ctx.page_title = l("Call Number Browse"); %] diff --git a/Open-ILS/src/templates/opac/library.tt2 b/Open-ILS/src/templates/opac/library.tt2 index 695566be72..702f30e9e5 100644 --- a/Open-ILS/src/templates/opac/library.tt2 +++ b/Open-ILS/src/templates/opac/library.tt2 @@ -3,7 +3,9 @@ INCLUDE "opac/parts/topnav.tt2"; ctx.page_title = l("Library details: [_1]", ctx.library.name); canon = ctx.proto _ '://' _ ctx.hostname _ mkurl('', {}, 1); - metalinks = ''; + ctx.metalinks.push(''); + ctx.metalinks.push(''); + ctx.metalinks.push(''); -%] [%- INCLUDE "opac/parts/searchbar.tt2" %] [%- INCLUDE "opac/parts/library/core_info.tt2"; %] diff --git a/Open-ILS/src/templates/opac/mylist.tt2 b/Open-ILS/src/templates/opac/mylist.tt2 index 611182277d..16488e2bc8 100644 --- a/Open-ILS/src/templates/opac/mylist.tt2 +++ b/Open-ILS/src/templates/opac/mylist.tt2 @@ -2,7 +2,7 @@ PROCESS "opac/parts/misc_util.tt2"; WRAPPER "opac/parts/base.tt2"; INCLUDE "opac/parts/topnav.tt2"; - metalinks = ''; + ctx.metalinks.push(''); ctx.page_title = l("Record Detail") %]

[% l('Temporary List') %]

diff --git a/Open-ILS/src/templates/opac/parts/base.tt2 b/Open-ILS/src/templates/opac/parts/base.tt2 index f971c5e553..540525d4a9 100644 --- a/Open-ILS/src/templates/opac/parts/base.tt2 +++ b/Open-ILS/src/templates/opac/parts/base.tt2 @@ -1,6 +1,6 @@ - + [% IF ctx.refresh %] @@ -18,7 +18,9 @@ [%-# Hook for page-specific metadata such as %] - [% metalinks; -%] + [%- ctx.metalinks.push(''); %] + [%- ctx.metalinks.push(''); %] + [% FOREACH meta IN ctx.metalinks; meta _ "\n"; END; -%] [% IF want_dojo %]