Add a toggle to show a link to a Google Map on Library Page user/mrpeters/include_google_map_on_core_info
authorMichael Peters <mpeters@emeralddata.net>
Wed, 10 Dec 2014 14:51:17 +0000 (09:51 -0500)
committerMichael Peters <mpeters@emeralddata.net>
Wed, 10 Dec 2014 14:51:17 +0000 (09:51 -0500)
By setting ctx.google_maps_link = 1 in config.tt2, a link
to a Google Map of the org unit in question will be placed
on the Library Page (core_info.tt2 aka eg/opac/library/CONS)
where CONS = shortname of org unit.

Signed-off-by: Michael Peters <mpeters@emeralddata.net>
Open-ILS/src/templates/opac/parts/config.tt2
Open-ILS/src/templates/opac/parts/library/core_info.tt2

index 8b0e69f..b050317 100644 (file)
@@ -160,6 +160,11 @@ search.basic_config = {
 ctx.google_books_preview = 0;
 
 ##############################################################################
+# Show Google Map Links on Library Info Pages
+# Set to 1 or 'true' to enable
+ctx.google_maps_link = 0;
+
+##############################################################################
 
 # Set a maintenance message to display in the catalogue
 #
index 1398f70..ed1f6c2 100644 (file)
     </div>
     [%- END; %]
 
+    [%- IF ctx.google_maps_link; %]
+        <a href="http://www.google.com/maps/place/[% ctx.mailing_address.street1 | html %]+[% ctx.mailing_address.street2 | html %]+[% ctx.mailing_address.city | html %]+[% ctx.mailing_address.state | html %]+[% ctx.mailing_address.post_code | html %]"> Generate Map & Directions</a>
+    [% END; -%]
+    
     [%- IF ctx.library.parent_ou; %]
     <h2>Branch relationship</h2>
     <div id="branch-info">[% l('Parent library: ') %]