DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:favicons

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
tips:favicons [2016-10-01 16:15] – [Favicons for the browser tab] SFITCStips:favicons [2017-05-11 06:16] – add link to favicon generation with GIMP 193.81.172.110
Line 22: Line 22:
    * a //favicon.ico// in the web root will **only** be used if there are **no** //favicon.ico// files in the //$DokuWiki// directory.    * a //favicon.ico// in the web root will **only** be used if there are **no** //favicon.ico// files in the //$DokuWiki// directory.
    * a //favicon.ico// in //$DokuWiki/data/media// will be used regardless of whether other //favicon.ico// files are beneath the web root directory.    * a //favicon.ico// in //$DokuWiki/data/media// will be used regardless of whether other //favicon.ico// files are beneath the web root directory.
-   * a //favicon.ico// in //$DokuWiki/lib/tpl/dokuwiki/images// will **only** be used if there is **no** //favicon.ico// in //$DokuWiki/data/media// ((NOTE: the same rules may not apply to the //favicon.ico// used to generate the image used for Opensearch)).+   * a //favicon.ico// in //$DokuWiki/lib/tpl/dokuwiki/images// will **only** be used if there is **no** //favicon.ico// in //$DokuWiki/data/media// ((NOTE: the same rules may not apply to the //favicon.ico// used to generate the image used for Opensearch)).  
 + 
 +Here you can find a tutorial how to generate a multi-resolution favicon with GIMP: [[https://www.catalyst.net.nz/news/creating-multi-resolution-favicon-including-transparency-gimp|catalyst.net]] 
 + 
 +====Animated Favicons for the browser tab==== 
 + 
 +If you'd like to display an animated gif {{https://scottferguson.com.au/uploads/files/animated_favicon.gif|Not for everyone}} instead of a static icon in the browser tab **and** you are using the default ''dokuwiki'' template (theme)((NOTE: a similar process will probably work with other themes - I haven't tested)):
 + 
 +  - Edit ''doku.php'' and change <code php>($conf['send404'] || preg_match('/^(robots\.txt|sitemap\.xml(\.gz)?|favicon\.ico|crossdomain\.xml)$/', $ID)) &&</code> to <code php>($conf['send404'] || preg_match('/^(robots\.txt|sitemap\.xml(\.gz)?|animated_favicon\.gif|favicon\.ico|crossdomain\.xml)$/', $ID)) &&</code> 
 +  - Edit ''inc/template.php'' and change <code php>* Returns <link> tag for various icon types (favicon|mobile|generic)</code> to <code php>* Returns <link> tag for various icon types (favicon|mobile|generic|animated)</code>, and change <code php>* @param  array $types - list of icon types to display (favicon|mobile|generic)</code> to <code php>* @param  array $types - list of icon types to display (favicon|mobile|generic|animated)</code>, and finally, change <code php>            case 'generic': 
 +                // ideal world solution, which doesn't work in any browser yet 
 +                $look = array(':wiki:favicon.svg', ':favicon.svg', 'images/favicon.svg'); 
 +                $return .= '<link rel="icon" href="'.tpl_getMediaFile($look).'" type="image/svg+xml" /$ 
 +                break;</code> to <code php>            case 'generic': 
 +                // ideal world solution, which doesn't work in any browser yet 
 +                $look = array(':wiki:favicon.svg', ':favicon.svg', 'images/favicon.svg'); 
 +                $return .= '<link rel="icon" href="'.tpl_getMediaFile($look).'" type="image/svg+xml" /$ 
 +                break; 
 +            case 'animated': 
 +                $look = array(':wiki:animated_favicon.gif', ':animated_favicon.gif', 'images/animated_$ 
 +                $return .= '<link rel="icon" type="image/gif" href="'.tpl_getMediaFile($look).'" />'.N$ 
 +                break;</code> 
 +  - Edit ''lib/tpl/dokuwiki/main.php'' and change <code php><?php echo tpl_favicon(array('favicon', 'mobile')) ?></code> to <code php><?php echo tpl_favicon(array('favicon', 'mobile', 'animated')) ?></code> 
 +  - Edit ''lib/tpl/dokuwiki/mediamanager.php'' and change <code php><?php echo tpl_favicon(array('favicon', 'mobile')) ?></code> <code php><?php echo tpl_favicon(array('favicon', 'mobile', 'animated')) ?></code> 
 +  - (Optional) Edit ''lib/tpl/dokuwiki/lang/en/style.txt'' and change <code>will be automatically used. You can also upload a ''favicon.ico'' there. If you use a closed 
 +wiki it is recommended to make the ''wiki'' (or root) namespace world readable in the ACL settings or your logo is not shown to not logged in users.</code> to <code>will be automatically used. You can also upload a ''favicon.ico'' or an ''animated_favicon.gif'' there. 
 +If you use a closed wiki it is recommended to make the ''wiki'' (or root) namespace world readable 
 + in the ACL settings or your logo is not shown to not logged in users.</code> 
 +  - Place your ''animated_favicon.gif'' in any of locations DokuWiki looks for favicons.ico files and refresh your browser.  
  
 ---- ----
  
-A work in progress     --- [[user>SFITCS|SFITCS]] //2016-10-01 16:10//+A work in progress      --- [[user>SFITCS]] //2017-03-17 01:00//
  
 If you'd like to help test how DokuWiki favicons are used for various things in different browsers you can download [[https://scottferguson.com.au/uploads/files/test_favicons.zip|this zip archive]] containing //favicon.ico// files with Red, Yellow, and Green backgrounds. Each //favicon.ico// has a 16x16, a 24x24, a 32x32, a 64x64, and a 128x128 pixel PNG images in it. All are 24-bit, and display a number corresponding to their dimensions so you can see which size is used by various browser themes. If you'd like to help test how DokuWiki favicons are used for various things in different browsers you can download [[https://scottferguson.com.au/uploads/files/test_favicons.zip|this zip archive]] containing //favicon.ico// files with Red, Yellow, and Green backgrounds. Each //favicon.ico// has a 16x16, a 24x24, a 32x32, a 64x64, and a 128x128 pixel PNG images in it. All are 24-bit, and display a number corresponding to their dimensions so you can see which size is used by various browser themes.
tips/favicons.txt · Last modified: 2024-02-22 16:42 by 77.174.103.188

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki