How can I add/configure additional favicon files? #406
-
Hi! Trying to start new theme fo Yellow. I use favicongenerator's result:
I've copied additional favicon files to the Refresh the page and see the default theme icon: How can I add path to my favicon files? Maybe Yellow API have some magic function for the path? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
The file you are looking for is Here's an example
Tested with Datenstrom Yellow 0.9 |
Beta Was this translation helpful? Give feedback.
-
Steffen, I did the same, but the default theme icon is still here: How can I rule this default parameter? |
Beta Was this translation helpful? Give feedback.
-
OK, I had to search a little bit since I'm not much into theming, but as it seems you can simply delete the unwanted icon from your HTH |
Beta Was this translation helpful? Give feedback.
-
Steffen, thanks a lot! I think it disappeared after png file deletion. |
Beta Was this translation helpful? Give feedback.
-
In the current version (0.8.23) you can also create a simple extension for this: <?php
class YellowFavicon
{
public const VERSION = "0.8.18";
public $yellow; // access to API
// Handle initialisation
public function onLoad($yellow) {
$this->yellow = $yellow;
}
// Handle page extra data
public function onParsePageExtra($page, $name) {
$output = null;
if ($name=="header") {
$themeLocation = $this->yellow->system->get("coreServerBase").$this->yellow->system->get("CoreThemeLocation");
$output .= "<link rel=\"shortcut icon\" href=\"{$themeLocation}favicon.ico\">";
}
}
}
?> If you have built your own theme with your own name, you can also use the line $output .= "<link rel=\"shortcut icon\" href=\"{$themeLocation}favicon.ico\">"; in the |
Beta Was this translation helpful? Give feedback.
-
I edited the path names in this question to make this work in current Datenstrom Yellow. Hope that's okay with you. |
Beta Was this translation helpful? Give feedback.
The file you are looking for is
system/layouts/header.html
. Just put your code between<head>...</head>
and adjust the paths to your icons if needed. You can also access core settings via the API to get location information.Here's an example
system/layouts/header.html
with adjusted path: