Author Topic: Favicon  (Read 1695 times)

0 Members and 1 Guest are viewing this topic.

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Favicon
« on: December 30, 2016, 12:30:45 PM »
I am experimenting/learning about favicon and have added <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> in <head> in the website root and the templates' root index files.
Have uploaded a favicon.ico to my komokaweather.com root as well as to the templates' root such as komokaweather-ca, weather, pws, and j-template www.komokaweather.com/favicon.ico

The favicon is not showing up with my station name and the template originals for Meteotemplate and HomeWeather are still showing www.komokaweather.com.

Have I missed something?

Paul




Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 724
    • Lake Huron Weather
Re: Favicon
« Reply #1 on: December 30, 2016, 01:36:15 PM »
Hey Paul, no I am not seeing your favicon.

This is what I have in the top.php file on my site, in the same section as the meta tags.
<link rel="shortcut icon" href="./favicon.png" type="image/x-icon" />

So do you have a png file?



CW3699

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Re: Favicon
« Reply #2 on: December 30, 2016, 02:00:05 PM »
Thanks Paul,
No my file is favicon.ico www.komokaweather.com/favicon.ico

Paul M

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 724
    • Lake Huron Weather
Re: Favicon
« Reply #3 on: December 30, 2016, 02:10:54 PM »
I have always used a png file.  Do you have software that will make one?  If not I do and can help.

CW3699

Offline ValentineWeather

  • Forecaster
  • *****
  • Posts: 6364
    • Valentine Nebraska's Real-Time Weather
Re: Favicon
« Reply #4 on: December 30, 2016, 02:21:45 PM »
I see it Paul.  :-)
Randy

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 724
    • Lake Huron Weather
Re: Favicon
« Reply #5 on: December 30, 2016, 02:31:01 PM »
I still don't see it Paul.  I sent you a PM.

CW3699

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Favicon
« Reply #6 on: December 30, 2016, 02:36:09 PM »
I think I had a similar problem, the problem is that the very first time you visit a page, the browser saves this and even if you later add it, it still uses whatever it saved originally. Even  hard refresh didnt help for me. If you were on Paul´s domain any time in the past, it is most likely remembering it. Only if this is the absolute first time you visited komokaweather from this computer, it will first look for it and save it. Im not sure, but this is what happened to me

Offline BCJKiwi

  • Forecaster
  • *****
  • Posts: 302
    • Silver Acorn Weather - N.Z.
Re: Favicon
« Reply #7 on: December 30, 2016, 03:02:28 PM »
Hi Paul,
I have
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
in both index.php and top.php

It seems the shortcut term is no longer required but typically remains.

However, on checking Ken's original sources I see he has only
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
in top.php

Just tested and found that everything works as Ken has it (of course it would!!  ;)
There is also some useful info here https://en.wikipedia.org/wiki/Favicon

The .ico file typically will have multiple sizes and colour depths.
The .png format cannot store these multiple file sizes and colour depths which are one of the requirements for an icon file.

However pretty much all modern browsers are set up to search for favicon.ico in the root folder of the website and thus will display the favicon without any link references in the web page(s) themselves.
Have also tested this and find it is correct for IE11, Edge, Chrome and FF.

So maybe the issue is the format of the .ico file.
There are a number of online favicon generators available so may be you could try one of those and see if it makes a difference? You will find these all generate multiple size and colour depth images within the same file.


Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Re: Favicon
« Reply #8 on: December 30, 2016, 03:49:30 PM »
Thanks guys, trying to understand while at the same time improving my www.komokaweather.com/mysql/top10.php

#Brian, I used www.favicon-generator.org to generate a favicon and it produced a whole list of PNG and JPG images and also a favicon.ici (Icon format 16x16).  It is this icon I have uploaded to my site root as well as the templates' root. 

I will have to play with the  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> in the index files and see if I can get it to show.

Paul

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Favicon
« Reply #9 on: December 30, 2016, 03:51:30 PM »
Your icon works Paul, it is browser cache. Try opening the console in the browser, in Chrome for example CTRL+SHIFT+I, then refresh the page while the console is opened, or try ctrl+f5 and see if it helps.

Offline waterside

  • Member
  • *
  • Posts: 22
    • Crab Meadow Weather
Re: Favicon
« Reply #10 on: December 30, 2016, 11:27:24 PM »
I can confirm the favicon is working for me as well, Paul.

I have found that browser caches get in the way of updated favicons too.  Typically I need to completely clear all history, all caches, etc in order to pick up new/changed favicons.  This seems pretty consistent across browsers.

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Re: Favicon
« Reply #11 on: December 31, 2016, 12:28:39 AM »

For me my favicon.ico works for www.komokaweather.com in Edge, FF and Chrome.
however that favicon.ico does not display for www.komokaweather.ca in any of the 3 browsers and instead displays a blank page icon.


and for the HomeWeather site www.komokaweather.com/pws my favicon.ico shows in FF, but not in Edge or Chrome where the template default favicon still show.


for the Meteotemplate template site www.komokaweather.com/j-template and the Leuven template site www.komokaweather.com/weather28 the original template default favicons still show.


I will continue to try changes in the <link rel="shortcut icon" href="./favicon.png" type="image/x-icon" /> in the Meteotemplate and Leuven root folders to get this working correctly.


Thanks for your feedback.
Paul