Wikka favicon.ico


I've uploaded a minipicture derived from the Wikka wizard to be used as a favicon:

images/favicon.ico
 (image: http://wikkawiki.org/images/favicon.ico)

The code

The following lines were added to actions/header.php:

    <link rel="icon" href="images/favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />


Issues

Feedback is welcome



With the current method, default favicon.ico need to be overwritten by a personalized one.
Problems:
- update : updating a wikka installation (folder copy) erase custom favicon.ico
- w3 : png support would be greater for linux users (only for 2nd proposal)

Proposal:
- add 'favicon' => 'images/favicon.ico' parameter to wikka.config.php

actions/header.php:
    <link rel="icon" href="images/favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />


// ===== favicon =====
$favicon = $this->GetConfigValue("favicon");
if ($favicon == '') { $favicon = 'images/favicon.ico'; }
echo '  <link rel="icon" href="'.$favicon.'" type="image/x-icon" />'."\n";
echo '  <link rel="shortcut icon" href="'.$favicon.'" type="image/x-icon" />'."\n";


// ===== favicon =====
$favicon = $this->GetConfigValue("favicon");
if ($favicon == '') { $favicon = 'images/favicon.ico'; }
if (substr($favicon, -4) == ".png") {
    echo '  <link rel="icon" type="image/png" href="'.$favicon.'" />'."\n";
} elseif (substr($favicon, -4) == ".gif") {
    echo '  <link rel="icon" type="image/gif" href="'.$favicon.'" />'."\n";
} elseif (substr($favicon, -4) == ".ico") {
    echo '  <link rel="icon" href="'.$favicon.'" type="image/x-icon" />'."\n";
    echo '  <link rel="shortcut icon" href="'.$favicon.'" type="image/x-icon" />'."\n";
}


note : could it be useful to allow disabling favicon? ('favicon' => 'none')


CategoryWikka
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki