From 4f71ee9d894dbcecde19b0718a834f3f4035b0a2 Mon Sep 17 00:00:00 2001 From: Ivo Bathke Date: Mon, 18 Oct 2021 11:34:56 +0200 Subject: [PATCH] improved favicon handling --- theme.php | 18 ++++++++++++++++++ tpl/layout/base.tpl | 31 ++++++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/theme.php b/theme.php index a3e7dec..3f51d98 100644 --- a/theme.php +++ b/theme.php @@ -523,12 +523,30 @@ 'type' => 'str', 'value' => 'favicon.ico', ), + array( + 'group' => 'favicons', + 'name' => 'sFaviconSvg', + 'type' => 'str', + 'value' => 'favicon.svg', + ), array( 'group' => 'favicons', 'name' => 'aOGImage', 'type' => 'str', 'value' => 'moga.png', ), + [ + 'group' => 'favicons', + 'name' => 'sSiteManifestFile', + 'type' => 'str', + 'value' => '', + ], + [ + 'group' => 'favicons', + 'name' => 'sThemeColor', + 'type' => 'str', + 'value' => '#ffffff', + ], //ANALYTICS array( diff --git a/tpl/layout/base.tpl b/tpl/layout/base.tpl index 3ec45b4..19ab168 100644 --- a/tpl/layout/base.tpl +++ b/tpl/layout/base.tpl @@ -48,7 +48,7 @@ [{else}] - [{assign var="aOGImage" value=$oViewConf->getViewThemeParam('aOGImage')}] + [{assign var="aOGImage" value=$oViewConf->getViewThemeParam('aOGImage')}] @@ -86,19 +86,30 @@ [{block name="head_link_favicon"}] [{assign var="aAppleTouchIcon" value=$oViewConf->getViewThemeParam('aAppleTouchIcon')}] + [{assign var="appleTouchIcon" value=$oViewConf->getImageUrl("favicons/`$aAppleTouchIcon`")}] [{if $aAppleTouchIcon}] - - - + [{assign var="appleTouchIcon72" value=$appleTouchIcon}] + [{assign var="appleTouchIcon144" value=$appleTouchIcon}] + [{if $oViewConf->isModuleActive('cnc/imagebutler')}] + [{assign var="appleTouchIcon72" value=$oViewConf->getDynamicImage($appleTouchIcon, 72, 72)}] + [{assign var="appleTouchIcon144" value=$oViewConf->getDynamicImage($appleTouchIcon, 144, 144)}] + [{/if}] + + + [{/if}] [{assign var="sFaviconFile" value=$oViewConf->getViewThemeParam('sFaviconFile')}] [{assign var="sFavicon16File" value=$oViewConf->getViewThemeParam('sFavicon16File')}] [{assign var="sFavicon32File" value=$oViewConf->getViewThemeParam('sFavicon32File')}] + [{assign var="sFaviconSvg" value=$oViewConf->getViewThemeParam('sFaviconSvg')}] + [{assign var="sSiteManifestFile" value=$oViewConf->getViewThemeParam('sSiteManifestFile')}] + [{assign var="sThemeColor" value=$oViewConf->getViewThemeParam('sThemeColor')}] + {*todo copy to root*} [{if $sFaviconFile}] - + [{/if}] [{if $sFavicon16File}] @@ -106,6 +117,16 @@ [{if $sFavicon32File}] [{/if}] + [{if $sFaviconSvg}] + + + [{/if}] + [{if $sSiteManifestFile}] + + [{/if}] + [{if $sThemeColor}] + + [{/if}] [{/block}] [{block name="base_style"}]