WebsiteBaker Community Forum
WebsiteBaker Support (2.11.x) => General Help & Support => Topic started by: apple on June 04, 2024, 09:17:21 PM
-
Hi, where do drop or save the favicon? Thanks
-
for search engines the right place is in your root directory of this domain, but not every browser read it from there automatically. best method is a link in the head of your index.php (from the template) and with this link, you can set the path, so it doesn't matter, where you have the favicon, if the patzh is correct
-
Hi, How do you link with the index file? Is there is code or sample I can see?
Thanks
-
Here some ofiicial informations about the thematic -> https://www.w3schools.com/html/html_favicon.asp
pls remember: every kind of file-type needs a special call.
for example:
GIF
<link rel="icon" type="image/gif" href="THE_COMPLETE_PATH TO_THE_FILE/FILENAME.gif">
PNG
<link rel="icon" type="image/png" href="THE_COMPLETE_PATH TO_THE_FILE/FILENAME.png">
ICO
<link rel="icon" type="image/x-icon" href="THE_COMPLETE_PATH TO_THE_FILE/favicon.ico">
SVG
<link rel="icon" href="THE_COMPLETE_PATH TO_THE_FILE/favicon.svg" type="image/svg+xml">
you can use the WB-Constant WB_URL or TEMPLATE_DIR in the path
WB_URL is the path to the root of this WB-Installation
TEMPLATE_DIR is the path to your on this page active frontend-template
example for favicon.ico in the root
<link rel="icon" type="image/x-icon" href="<?php echo WB_URL; ?>favicon.ico">
or (short version)
<link rel="icon" type="image/x-icon" href="<?= WB_URL; ?>favicon.ico">
example for favicon.ico in your frontend-template
<link rel="icon" type="image/x-icon" href="<?php echo TEMPLATE_DIR; ?>favicon.ico">
or (short version)
<link rel="icon" type="image/x-icon" href="<?= TEMPLATE_DIR; ?>favicon.ico">
also possible
<link rel="shortcut icon" href="<?= TEMPLATE_DIR; ?>favicon.ico" type="image/x-icon">
P.S.: its a good solution, if you have a favicon.ico in the root fot the automatic browser detection and if you need, another icon (like the apple-touch-icon) in your frontend-template
apple use a special form and call it "apple touch icon". it has more possibilities about size and resolution. You can use both kind of icons
<link rel="apple-touch-icon" href="<?= TEMPLATE_DIR;?>apple-touch-icon.png">
-
Thanks. Do you mean the index.php in the template directory?
-
Thanks. Do you mean the index.php in the template directory?
YES - the index.php of the used frontend-template, for example index.php in /templates/DefaultTemplate
if you use more than one template in your project, add it in every index.php from every installed frontend-template
-
Thanks. Do you mean the index.php in the template directory?
YES - the index.php of the used frontend-template, for example index.php in /templates/DefaultTemplate
if you use more than one template in your project, add it in every index.php from every installed frontend-template
Thank you for your prompt reply. That was very helpful.