gmulibdigital / OJS2-Theme

OJS2 Customization by the Mason Publishing team
http://www.publishing.gmu.edu
10 stars 23 forks source link

templates/common/head.tpl - favicon overrides configured one + google fonts css not loaded for https sites #10

Open hermannschwaerzlerUIBK opened 7 years ago

hermannschwaerzlerUIBK commented 7 years ago

In templates/common/head.tpl there are two issues:

  1. a hard coded favicon of the theme is added to the head of every page overriding any favicon configured in the journal setup.
  2. an http-URL is used in order to add fonts style sheets. If the site is using https browsers refuse to load anything over http.

See below a proposed patch for these two, that

  1. uses the configured favicon. This is somewhat superfluous as it adds the favicon link twice. So another possible solution is to totally remove that part.
  2. gives no protocol for the fonts URL which means the browser uses the one of the page.
diff --git a/templates/common/head.tpl b/templates/common/head.tpl
index 6dadee0..59d9165 100644
--- a/templates/common/head.tpl
+++ b/templates/common/head.tpl
@@ -11,10 +11,10 @@
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <!-- Add Favicon -->

-<link rel="icon" type="img/ico" href="{$baseUrl}/plugins/themes/mpg/img/favicon.ico" />
+{if $displayFavicon}<link rel="icon" href="{$faviconDir}/{$displayFavicon.uploadName|escape:"url"}" type="{$displayFavicon.mimeType|escape}" />{/if}

 <!-- Add fonts style sheet -->
-<link href='http://fonts.googleapis.com/css?family=Lato:300,400,700|PT+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+<link href='//fonts.googleapis.com/css?family=Lato:300,400,700|PT+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
 <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

 <!-- Add theme style sheet -->